hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/leds/leds-cpcap.c
....@@ -1,14 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (c) 2017 Sebastian Reichel <sre@kernel.org>
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 or
6
- * later as published by the Free Software Foundation.
7
- *
8
- * This program is distributed in the hope that it will be useful,
9
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
- * GNU General Public License for more details.
124 */
135
146 #include <linux/leds.h>
....@@ -166,19 +158,14 @@
166158
167159 static int cpcap_led_probe(struct platform_device *pdev)
168160 {
169
- const struct of_device_id *match;
170161 struct cpcap_led *led;
171162 int err;
172
-
173
- match = of_match_device(of_match_ptr(cpcap_led_of_match), &pdev->dev);
174
- if (!match || !match->data)
175
- return -EINVAL;
176163
177164 led = devm_kzalloc(&pdev->dev, sizeof(*led), GFP_KERNEL);
178165 if (!led)
179166 return -ENOMEM;
180167 platform_set_drvdata(pdev, led);
181
- led->info = match->data;
168
+ led->info = device_get_match_data(&pdev->dev);
182169 led->dev = &pdev->dev;
183170
184171 if (led->info->reg == 0x0000) {