lkml.org 
[lkml]   [2020]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH leds v2 12/50] leds: bcm6328: cosmetic: use reverse christmas tree
Date
Only a cosmetic change: use reverse christmas tree variables
declaration.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Álvaro Fernández Rojas <noltari@gmail.com>
Cc: Kevin Cernekee <cernekee@gmail.com>
Cc: Jaedon Shin <jaedon.shin@gmail.com>
---
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
\
 
 \ /
  Last update: 2020-09-18 00:37    [W:0.283 / U:0.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site