From: Chris Boot Date: Fri, 29 Sep 2006 08:59:08 +0000 (-0700) Subject: [PATCH] Make net48xx-led use scx200_gpio_ops X-Git-Tag: v3.12-rc1~33597 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cfedc920a7bca828fd4af8e203f7d8514990f999;p=kernel%2Fkernel-generic.git [PATCH] Make net48xx-led use scx200_gpio_ops Make the next48xx LED code use scx200_gpio_ops instead of raw SCx200 GPIO accesses. Signed-off-by: Chris Boot Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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 #include #include +#include #include #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; }