Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cfedc920 authored by Chris Boot's avatar Chris Boot Committed by Linus Torvalds
Browse files

[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: default avatarChris Boot <bootc@bootc.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 58012cd7
Loading
Loading
Loading
Loading
+4 −5
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@
#include <linux/leds.h>
#include <linux/leds.h>
#include <linux/err.h>
#include <linux/err.h>
#include <asm/io.h>
#include <asm/io.h>
#include <linux/nsc_gpio.h>
#include <linux/scx200_gpio.h>
#include <linux/scx200_gpio.h>


#define DRVNAME "net48xx-led"
#define DRVNAME "net48xx-led"
@@ -26,10 +27,7 @@ static struct platform_device *pdev;
static void net48xx_error_led_set(struct led_classdev *led_cdev,
static void net48xx_error_led_set(struct led_classdev *led_cdev,
		enum led_brightness value)
		enum led_brightness value)
{
{
	if (value)
	scx200_gpio_ops.gpio_set(NET48XX_ERROR_LED_GPIO, value ? 1 : 0);
		scx200_gpio_set_high(NET48XX_ERROR_LED_GPIO);
	else
		scx200_gpio_set_low(NET48XX_ERROR_LED_GPIO);
}
}


static struct led_classdev net48xx_error_led = {
static struct led_classdev net48xx_error_led = {
@@ -81,7 +79,8 @@ static int __init net48xx_led_init(void)
{
{
	int ret;
	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;
		ret = -ENODEV;
		goto out;
		goto out;
	}
	}