Commit 8853c95e authored by Marek Behún's avatar Marek Behún Committed by Pavel Machek
Browse files

leds: various: use dev_of_node(dev) instead of dev->of_node



The dev_of_node function should be preferred.

Signed-off-by: default avatarMarek Behún <marek.behun@nic.cz>
Cc: Orson Zhai <orsonzhai@gmail.com>
Cc: Baolin Wang <baolin.wang7@gmail.com>
Cc: Chunyan Zhang <zhang.lyra@gmail.com>
Cc: Sean Wang <sean.wang@mediatek.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
parent 2779f472
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -118,9 +118,9 @@ static int pm860x_led_dt_init(struct platform_device *pdev,
	struct device_node *nproot, *np;
	int iset = 0;

	if (!pdev->dev.parent->of_node)
	if (!dev_of_node(pdev->dev.parent))
		return -ENODEV;
	nproot = of_get_child_by_name(pdev->dev.parent->of_node, "leds");
	nproot = of_get_child_by_name(dev_of_node(pdev->dev.parent), "leds");
	if (!nproot) {
		dev_err(&pdev->dev, "failed to find leds node\n");
		return -ENODEV;
+1 −1
Original line number Diff line number Diff line
@@ -248,7 +248,7 @@ static int aat1290_led_parse_dt(struct aat1290_led *led,
	}
#endif

	child_node = of_get_next_available_child(dev->of_node, NULL);
	child_node = of_get_next_available_child(dev_of_node(dev), NULL);
	if (!child_node) {
		dev_err(dev, "No DT child node found for connected LED.\n");
		return -EINVAL;
+1 −1
Original line number Diff line number Diff line
@@ -202,7 +202,7 @@ static int an30259a_blink_set(struct led_classdev *cdev,
static int an30259a_dt_init(struct i2c_client *client,
			    struct an30259a *chip)
{
	struct device_node *np = client->dev.of_node, *child;
	struct device_node *np = dev_of_node(&client->dev), *child;
	int count, ret;
	int i = 0;
	const char *str;
+1 −1
Original line number Diff line number Diff line
@@ -261,7 +261,7 @@ static int aw2013_blink_set(struct led_classdev *cdev,

static int aw2013_probe_dt(struct aw2013 *chip)
{
	struct device_node *np = chip->client->dev.of_node, *child;
	struct device_node *np = dev_of_node(&chip->client->dev), *child;
	int count, ret = 0, i = 0;
	struct aw2013_led *led;

+1 −1
Original line number Diff line number Diff line
@@ -395,7 +395,7 @@ static int bcm6328_led(struct device *dev, struct device_node *nc, u32 reg,
static int bcm6328_leds_probe(struct platform_device *pdev)
{
	struct device *dev = &pdev->dev;
	struct device_node *np = pdev->dev.of_node;
	struct device_node *np = dev_of_node(&pdev->dev);
	struct device_node *child;
	void __iomem *mem;
	spinlock_t *lock; /* memory lock */
Loading