diff options
author | Marek BehĂșn <marek.behun@nic.cz> | 2020-09-18 00:32:52 +0200 |
---|---|---|
committer | Pavel Machek <pavel@ucw.cz> | 2020-09-26 21:56:39 +0200 |
commit | 2779f4724b2ff0f296313e5987d10a6ec2c2ebd5 (patch) | |
tree | ac8871c440fd900f23dafe4781ffa101418091fc /drivers/leds/leds-cpcap.c | |
parent | 2aebb78040e741949ac71f1203f003351061b93b (diff) | |
download | linux-stable-2779f4724b2ff0f296313e5987d10a6ec2c2ebd5.tar.gz linux-stable-2779f4724b2ff0f296313e5987d10a6ec2c2ebd5.tar.bz2 linux-stable-2779f4724b2ff0f296313e5987d10a6ec2c2ebd5.zip |
leds: various: use device_get_match_data
Simply use device_get_match_data instead of matching against the match
table again.
Signed-off-by: Marek BehĂșn <marek.behun@nic.cz>
Cc: H. Nikolaus Schaller <hns@goldelico.com>
Cc: David Rivshin <drivshin@allworx.com>
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Christian Mauderer <oss@c-mauderer.de>
Cc: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Diffstat (limited to 'drivers/leds/leds-cpcap.c')
-rw-r--r-- | drivers/leds/leds-cpcap.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/leds/leds-cpcap.c b/drivers/leds/leds-cpcap.c index 9f3fa4737213..7d41ce8c9bb1 100644 --- a/drivers/leds/leds-cpcap.c +++ b/drivers/leds/leds-cpcap.c @@ -158,19 +158,14 @@ MODULE_DEVICE_TABLE(of, cpcap_led_of_match); static int cpcap_led_probe(struct platform_device *pdev) { - const struct of_device_id *match; struct cpcap_led *led; int err; - match = of_match_device(of_match_ptr(cpcap_led_of_match), &pdev->dev); - if (!match || !match->data) - return -EINVAL; - led = devm_kzalloc(&pdev->dev, sizeof(*led), GFP_KERNEL); if (!led) return -ENOMEM; platform_set_drvdata(pdev, led); - led->info = match->data; + led->info = device_get_match_data(&pdev->dev); led->dev = &pdev->dev; if (led->info->reg == 0x0000) { |