| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * 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. |
|---|
| 12 | 4 | */ |
|---|
| 13 | 5 | |
|---|
| 14 | 6 | #include <linux/leds.h> |
|---|
| .. | .. |
|---|
| 166 | 158 | |
|---|
| 167 | 159 | static int cpcap_led_probe(struct platform_device *pdev) |
|---|
| 168 | 160 | { |
|---|
| 169 | | - const struct of_device_id *match; |
|---|
| 170 | 161 | struct cpcap_led *led; |
|---|
| 171 | 162 | 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; |
|---|
| 176 | 163 | |
|---|
| 177 | 164 | led = devm_kzalloc(&pdev->dev, sizeof(*led), GFP_KERNEL); |
|---|
| 178 | 165 | if (!led) |
|---|
| 179 | 166 | return -ENOMEM; |
|---|
| 180 | 167 | platform_set_drvdata(pdev, led); |
|---|
| 181 | | - led->info = match->data; |
|---|
| 168 | + led->info = device_get_match_data(&pdev->dev); |
|---|
| 182 | 169 | led->dev = &pdev->dev; |
|---|
| 183 | 170 | |
|---|
| 184 | 171 | if (led->info->reg == 0x0000) { |
|---|