From: Chris Boot <bootc@bootc.net>
To: Chris Boot <bootc@bootc.net>
Cc: kernel list <linux-kernel@vger.kernel.org>,
Jim Cromie <jim.cromie@gmail.com>, Andrew Morton <akpm@osdl.org>,
Adrian Bunk <bunk@stusta.de>
Subject: Re: [RESEND][PATCH] Make net48xx-led use scx200_gpio_ops
Date: Sat, 15 Jul 2006 19:49:24 +0100 [thread overview]
Message-ID: <44B938B4.1050404@bootc.net> (raw)
In-Reply-To: <44B93808.8080703@bootc.net>
[-- Attachment #1: Type: text/plain, Size: 393 bytes --]
Chris Boot wrote:
> Make the next48xx LED code use scx200_gpio_ops instead of raw SCx200
> GPIO accesses.
>
> Signed-off-by: Chris Boot <bootc@bootc.net>
>
> ---
>
> Resending since I forgot the subject in the last message! Oops!
Resending *again* because Thunderbird eats patches and I keep forgetting!
Anybody have a fix for this?
--
Chris Boot
bootc@bootc.net
http://www.bootc.net/
[-- Attachment #2: net48xx-led-use-gpio-ops.patch --]
[-- Type: text/x-patch, Size: 989 bytes --]
diff --git a/drivers/leds/leds-net48xx.c b/drivers/leds/leds-net48xx.c
index 713c4a8..45ba3d4 100644
--- a/drivers/leds/leds-net48xx.c
+++ b/drivers/leds/leds-net48xx.c
@@ -16,6 +16,7 @@
#include <linux/leds.h>
#include <linux/err.h>
#include <asm/io.h>
+#include <linux/nsc_gpio.h>
#include <linux/scx200_gpio.h>
#define DRVNAME "net48xx-led"
@@ -26,10 +27,7 @@ static struct platform_device *pdev;
static void net48xx_error_led_set(struct led_classdev *led_cdev,
enum led_brightness value)
{
- if (value)
- scx200_gpio_set_high(NET48XX_ERROR_LED_GPIO);
- else
- scx200_gpio_set_low(NET48XX_ERROR_LED_GPIO);
+ scx200_gpio_ops.gpio_set(NET48XX_ERROR_LED_GPIO, value ? 1 : 0);
}
static struct led_classdev net48xx_error_led = {
@@ -81,7 +79,8 @@ static int __init net48xx_led_init(void)
{
int ret;
- if (!scx200_gpio_present()) {
+ /* small hack, but scx200_gpio doesn't set .dev if the probe fails */
+ if (!scx200_gpio_ops.dev) {
ret = -ENODEV;
goto out;
}
prev parent reply other threads:[~2006-07-15 18:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-15 18:46 [RESEND][PATCH] Make net48xx-led use scx200_gpio_ops Chris Boot
2006-07-15 18:49 ` Chris Boot [this message]
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=44B938B4.1050404@bootc.net \
--to=bootc@bootc.net \
--cc=akpm@osdl.org \
--cc=bunk@stusta.de \
--cc=jim.cromie@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.