summaryrefslogtreecommitdiff
path: root/drivers/leds/leds-spi-byte.c
diff options
context:
space:
mode:
authorMarek BehĂșn <marek.behun@nic.cz>2020-09-18 00:32:54 +0200
committerPavel Machek <pavel@ucw.cz>2020-09-26 21:56:39 +0200
commit8853c95e997e0a3621bd8718bdaded81ed37bc9a (patch)
treef0bd3a4907901243e12ce8a18caf1a8d313e7f3c /drivers/leds/leds-spi-byte.c
parent2779f4724b2ff0f296313e5987d10a6ec2c2ebd5 (diff)
leds: various: use dev_of_node(dev) instead of dev->of_node
The dev_of_node function should be preferred. Signed-off-by: Marek 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: Pavel Machek <pavel@ucw.cz>
Diffstat (limited to 'drivers/leds/leds-spi-byte.c')
-rw-r--r--drivers/leds/leds-spi-byte.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/leds/leds-spi-byte.c b/drivers/leds/leds-spi-byte.c
index 9632eb84f8de..ecfd349fa53b 100644
--- a/drivers/leds/leds-spi-byte.c
+++ b/drivers/leds/leds-spi-byte.c
@@ -87,11 +87,11 @@ static int spi_byte_probe(struct spi_device *spi)
const char *state;
int ret;
- if (of_get_child_count(dev->of_node) != 1) {
+ if (of_get_child_count(dev_of_node(dev)) != 1) {
dev_err(dev, "Device must have exactly one LED sub-node.");
return -EINVAL;
}
- child = of_get_next_child(dev->of_node, NULL);
+ child = of_get_next_child(dev_of_node(dev), NULL);
led = devm_kzalloc(dev, sizeof(*led), GFP_KERNEL);
if (!led)