From: Lars-Peter Clausen <lars@metafoo.de>
To: christian.gmeiner@gmail.com
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
bigeasy@linutronix.de, rpurdie@rpsys.net
Subject: Re: [PATCH v2] add led driver for Bachmann's ot200
Date: Mon, 09 Jan 2012 13:51:11 +0100 [thread overview]
Message-ID: <4F0AE2BF.6080605@metafoo.de> (raw)
In-Reply-To: <4F0AC06C.3000502@gmail.com>
On 01/09/2012 11:24 AM, Christian Gmeiner wrote:
> From a7fecf3426ef98fdd19e9d2610665b9d1ce358a0 Mon Sep 17 00:00:00 2001
> From: Sebastian Andrzej Siewior <bigeasy@linutronix.de
> <mailto:bigeasy@linutronix.de>>
> Date: Mon, 9 Jan 2012 10:09:50 +0100
> Subject: [PATCH v2] add led driver for Bachmann's ot200
>
> This patch adds support for leds on Bachmann's ot200 visualisation device.
> The device has three leds on the back panel (led_err, led_init and led_run)
> and can handle up to seven leds on the front panel.
>
> The driver was written by Linutronix on behalf of
> Bachmann electronic GmbH.
>
> Changes in v2:
> - *incorporated* feedback from Andrew Morton and Lars-Peter Clausen
>
looks good to me except some minor style issues and the <mailto:...> tags.
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de
> <mailto:bigeasy@linutronix.de>>
> Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com
> <mailto:christian.gmeiner@gmail.com>>
> ---
> [...]
> diff --git a/drivers/leds/leds-ot200.c b/drivers/leds/leds-ot200.c
> new file mode 100644
> index 0000000..4d000ac
> --- /dev/null
> +++ b/drivers/leds/leds-ot200.c
> @@ -0,0 +1,177 @@
> [...]
> +
> +static int __devinit ot200_led_probe(struct platform_device *pdev)
> +{
> + int i;
> + int ret;
> +
> + for (i = 0; i < ARRAY_SIZE(leds); i++) {
> +
> + leds[i].cdev.name = leds[i].name;
> + leds[i].cdev.default_trigger = NULL;
> + leds[i].cdev.blink_set = NULL;
No need to initialize to NULL.
> + leds[i].cdev.brightness_set = ot200_led_brightness_set;
> +
> + ret = led_classdev_register(&pdev->dev, &leds[i].cdev);
> + if (ret < 0)
> + goto err;
> +
> + dev_set_drvdata(leds[i].cdev.dev, &leds[i]);
Neither this ...
> + }
> +
> + platform_set_drvdata(pdev, leds);
nor this is ever used.
> +
> + outb(0x0, 0x49); /* turn off all front leds */
> + outb(0x2, 0x5a); /* turn on init led */
> + leds_front = 0;
> + leds_back = BIT(1);
Maybe initialize leds_front and leds_back first and pass it to outb.
> +
> + return 0;
> +
> +err:
> + for (i = i - 1; i >= 0; i--)
> + led_classdev_unregister(&leds[i].cdev);
> +
> + return ret;
> +}
> +
next prev parent reply other threads:[~2012-01-09 12:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-09 10:24 [PATCH v2] add led driver for Bachmann's ot200 Christian Gmeiner
2012-01-09 12:51 ` Lars-Peter Clausen [this message]
2012-01-09 14:05 ` Christian Gmeiner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F0AE2BF.6080605@metafoo.de \
--to=lars@metafoo.de \
--cc=akpm@linux-foundation.org \
--cc=bigeasy@linutronix.de \
--cc=christian.gmeiner@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rpurdie@rpsys.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox