From 2779f4724b2ff0f296313e5987d10a6ec2c2ebd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Beh=C3=BAn?= Date: Fri, 18 Sep 2020 00:32:52 +0200 Subject: leds: various: use device_get_match_data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Simply use device_get_match_data instead of matching against the match table again. Signed-off-by: Marek BehĂșn Cc: H. Nikolaus Schaller Cc: David Rivshin Cc: Sebastian Reichel Cc: Christian Mauderer Cc: Andrew Lunn Signed-off-by: Pavel Machek --- drivers/leds/leds-is31fl319x.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'drivers/leds/leds-is31fl319x.c') diff --git a/drivers/leds/leds-is31fl319x.c b/drivers/leds/leds-is31fl319x.c index 54ac50740d43..b039ffa33559 100644 --- a/drivers/leds/leds-is31fl319x.c +++ b/drivers/leds/leds-is31fl319x.c @@ -203,7 +203,6 @@ static int is31fl319x_parse_dt(struct device *dev, struct is31fl319x_chip *is31) { struct device_node *np = dev->of_node, *child; - const struct of_device_id *of_dev_id; int count; int ret; @@ -219,18 +218,11 @@ static int is31fl319x_parse_dt(struct device *dev, return ret; } - of_dev_id = of_match_device(of_is31fl319x_match, dev); - if (!of_dev_id) { - dev_err(dev, "Failed to match device with supported chips\n"); - return -EINVAL; - } - - is31->cdef = of_dev_id->data; + is31->cdef = device_get_match_data(dev); count = of_get_child_count(np); - dev_dbg(dev, "probe %s with %d leds defined in DT\n", - of_dev_id->compatible, count); + dev_dbg(dev, "probing with %d leds defined in DT\n", count); if (!count || count > is31->cdef->num_leds) { dev_err(dev, "Number of leds defined must be between 1 and %u\n", -- cgit v1.2.1