[PATCH leds v2 12/50] leds: bcm6328: cosmetic: use reverse christmas tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Only a cosmetic change: use reverse christmas tree variables
declaration.

Signed-off-by: Marek Behún <marek.behun@xxxxxx>
Cc: Álvaro Fernández Rojas <noltari@xxxxxxxxx>
Cc: Kevin Cernekee <cernekee@xxxxxxxxx>
Cc: Jaedon Shin <jaedon.shin@xxxxxxxxx>
---
 drivers/leds/leds-bcm6328.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/leds/leds-bcm6328.c b/drivers/leds/leds-bcm6328.c
index c72b0842e8151..38bf820372528 100644
--- a/drivers/leds/leds-bcm6328.c
+++ b/drivers/leds/leds-bcm6328.c
@@ -109,8 +109,8 @@ static unsigned long bcm6328_pin2shift(unsigned long pin)
 
 static void bcm6328_led_mode(struct bcm6328_led *led, unsigned long value)
 {
-	void __iomem *mode;
 	unsigned long val, shift;
+	void __iomem *mode;
 
 	shift = bcm6328_pin2shift(led->pin);
 	if (shift / 16)
@@ -255,8 +255,8 @@ static int bcm6328_blink_set(struct led_classdev *led_cdev,
 static int bcm6328_hwled(struct device *dev, struct device_node *nc, u32 reg,
 			 void __iomem *mem, spinlock_t *lock)
 {
-	int i, cnt;
 	unsigned long flags, val;
+	int i, cnt;
 
 	spin_lock_irqsave(lock, flags);
 	val = bcm6328_led_read(mem + BCM6328_REG_HWDIS);
@@ -271,8 +271,8 @@ static int bcm6328_hwled(struct device *dev, struct device_node *nc, u32 reg,
 	cnt = of_property_count_elems_of_size(nc, "brcm,link-signal-sources",
 					      sizeof(u32));
 	for (i = 0; i < cnt; i++) {
-		u32 sel;
 		void __iomem *addr;
+		u32 sel;
 
 		if (reg < 4)
 			addr = mem + BCM6328_REG_LNKACTSEL_LO;
@@ -298,8 +298,8 @@ static int bcm6328_hwled(struct device *dev, struct device_node *nc, u32 reg,
 					      "brcm,activity-signal-sources",
 					      sizeof(u32));
 	for (i = 0; i < cnt; i++) {
-		u32 sel;
 		void __iomem *addr;
+		u32 sel;
 
 		if (reg < 4)
 			addr = mem + BCM6328_REG_LNKACTSEL_LO;
@@ -395,12 +395,11 @@ static int bcm6328_led(struct device *dev, struct device_node *nc, u32 reg,
 
 static int bcm6328_leds_probe(struct platform_device *pdev)
 {
+	unsigned long val, *blink_leds, *blink_delay;
 	struct device *dev = &pdev->dev;
-	struct device_node *np = dev_of_node(&pdev->dev);
-	struct device_node *child;
+	struct device_node *np, *child;
 	void __iomem *mem;
 	spinlock_t *lock; /* memory lock */
-	unsigned long val, *blink_leds, *blink_delay;
 
 	mem = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mem))
@@ -426,6 +425,8 @@ static int bcm6328_leds_probe(struct platform_device *pdev)
 	bcm6328_led_write(mem + BCM6328_REG_LNKACTSEL_HI, 0);
 	bcm6328_led_write(mem + BCM6328_REG_LNKACTSEL_LO, 0);
 
+	np = dev_of_node(dev);
+
 	val = bcm6328_led_read(mem + BCM6328_REG_INIT);
 	val &= ~(BCM6328_INIT_MASK);
 	if (of_property_read_bool(np, "brcm,serial-leds"))
@@ -441,8 +442,8 @@ static int bcm6328_leds_probe(struct platform_device *pdev)
 	bcm6328_led_write(mem + BCM6328_REG_INIT, val);
 
 	for_each_available_child_of_node(np, child) {
-		int rc;
 		u32 reg;
+		int rc;
 
 		if (of_property_read_u32(child, "reg", &reg))
 			continue;
-- 
2.26.2




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux