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

Commit e81d372f authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull LED subsystem update from Bryan Wu.

* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds: (47 commits)
  leds: leds-lp5521: return an error code on error in probe()
  leds: leds-clevo-mail: Use pr_* instead of printks
  leds: leds-rb532: Fix checkpatch errors
  leds: led-triggers: Fix checkpatch warnings
  leds: ledtrig-backlight: Fix checkpatch error
  leds: leds-wrap: Use <linux/io.h> instead of <asm/io.h>
  leds: leds-wm8350: Use dev_err instead of printk
  leds: leds-pwm: Fix checkpatch warning
  leds: leds-pca955x: Use dev_info instead of printk
  leds: leds-net48xx: Use linux/io.h instead of asm/io.h
  leds: leds-lt3593: Fix checkpatch warnings
  leds: leds-gpio: Use dev_info instead of printk
  leds: leds-da903x: Fix checkpatch error and warnings
  leds: leds-bd2802: Fix checkpatch warnings
  leds: leds-adp5520: Fix checkpatch warnings
  leds: led-class: Fix checkpatch warning
  leds: leds-ns2: use devm_gpio_request_one
  leds: leds-lt3593: use devm_gpio_request_one
  leds: leds-gpio: use devm_gpio_request_one
  leds: lp3944: Fix return value
  ...
parents 75e300c8 2f05e1d4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -211,7 +211,7 @@ int led_classdev_register(struct device *parent, struct led_classdev *led_cdev)
	led_trigger_set_default(led_cdev);
#endif

	printk(KERN_DEBUG "Registered led device: %s\n",
	dev_dbg(parent, "Registered led device: %s\n",
			led_cdev->name);

	return 0;
+19 −6
Original line number Diff line number Diff line
@@ -166,6 +166,19 @@ void led_trigger_set_default(struct led_classdev *led_cdev)
}
EXPORT_SYMBOL_GPL(led_trigger_set_default);

void led_trigger_rename_static(const char *name, struct led_trigger *trig)
{
	/* new name must be on a temporary string to prevent races */
	BUG_ON(name == trig->name);

	down_write(&triggers_list_lock);
	/* this assumes that trig->name was originaly allocated to
	 * non constant storage */
	strcpy((char *)trig->name, name);
	up_write(&triggers_list_lock);
}
EXPORT_SYMBOL_GPL(led_trigger_rename_static);

/* LED Trigger Interface */

int led_trigger_register(struct led_trigger *trig)
@@ -300,13 +313,13 @@ void led_trigger_register_simple(const char *name, struct led_trigger **tp)
		if (err < 0) {
			kfree(trig);
			trig = NULL;
			printk(KERN_WARNING "LED trigger %s failed to register"
				" (%d)\n", name, err);
			pr_warn("LED trigger %s failed to register (%d)\n",
				name, err);
		}
	} else {
		pr_warn("LED trigger %s failed to register (no memory)\n",
			name);
	}
	} else
		printk(KERN_WARNING "LED trigger %s failed to register"
			" (no memory)\n", name);

	*tp = trig;
}
EXPORT_SYMBOL_GPL(led_trigger_register_simple);
+2 −7
Original line number Diff line number Diff line
@@ -165,15 +165,13 @@ static int pm860x_led_probe(struct platform_device *pdev)
	res = platform_get_resource_byname(pdev, IORESOURCE_REG, "control");
	if (!res) {
		dev_err(&pdev->dev, "No REG resource for control\n");
		ret = -ENXIO;
		goto out;
		return -ENXIO;
	}
	data->reg_control = res->start;
	res = platform_get_resource_byname(pdev, IORESOURCE_REG, "blink");
	if (!res) {
		dev_err(&pdev->dev, "No REG resource for blink\n");
		ret = -ENXIO;
		goto out;
		return -ENXIO;
	}
	data->reg_blink = res->start;
	memset(data->name, 0, MFD_NAME_SIZE);
@@ -224,9 +222,6 @@ static int pm860x_led_probe(struct platform_device *pdev)
	}
	pm860x_led_set(&data->cdev, 0);
	return 0;
out:
	devm_kfree(&pdev->dev, data);
	return ret;
}

static int pm860x_led_remove(struct platform_device *pdev)
+5 −5
Original line number Diff line number Diff line
@@ -328,7 +328,7 @@ static ssize_t bd2802_store_reg##reg_addr(struct device *dev, \
	int ret;							\
	if (!count)							\
		return -EINVAL;						\
	ret = strict_strtoul(buf, 16, &val);				\
	ret = kstrtoul(buf, 16, &val);					\
	if (ret)							\
		return ret;						\
	down_write(&led->rwsem);					\
@@ -492,7 +492,7 @@ static ssize_t bd2802_store_##attr_name(struct device *dev, \
	int ret;							\
	if (!count)							\
		return -EINVAL;						\
	ret = strict_strtoul(buf, 16, &val);				\
	ret = kstrtoul(buf, 16, &val);					\
	if (ret)							\
		return ret;						\
	down_write(&led->rwsem);					\
+5 −6
Original line number Diff line number Diff line
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>

@@ -26,7 +27,7 @@ static struct platform_device *pdev;

static int __init clevo_mail_led_dmi_callback(const struct dmi_system_id *id)
{
	printk(KERN_INFO KBUILD_MODNAME ": '%s' found\n", id->ident);
	pr_info("'%s' found\n", id->ident);
	return 1;
}

@@ -135,8 +136,7 @@ static int clevo_mail_led_blink(struct led_classdev *led_cdev,
		status = 0;

	} else {
		printk(KERN_DEBUG KBUILD_MODNAME
		       ": clevo_mail_led_blink(..., %lu, %lu),"
		pr_debug("clevo_mail_led_blink(..., %lu, %lu),"
		       " returning -EINVAL (unsupported)\n",
		       *delay_on, *delay_off);
	}
@@ -183,7 +183,7 @@ static int __init clevo_mail_led_init(void)
		count = dmi_check_system(clevo_mail_led_dmi_table);
	} else {
		count = 1;
		printk(KERN_ERR KBUILD_MODNAME ": Skipping DMI detection. "
		pr_err("Skipping DMI detection. "
		       "If the driver works on your hardware please "
		       "report model and the output of dmidecode in tracker "
		       "at http://sourceforge.net/projects/clevo-mailled/\n");
@@ -197,8 +197,7 @@ static int __init clevo_mail_led_init(void)
		error = platform_driver_probe(&clevo_mail_led_driver,
					      clevo_mail_led_probe);
		if (error) {
			printk(KERN_ERR KBUILD_MODNAME
			       ": Can't probe platform driver\n");
			pr_err("Can't probe platform driver\n");
			platform_device_unregister(pdev);
		}
	} else
Loading