Skip to content

Commit 3a1d61d

Browse files
author
Tzung-Bi Shih
committed
platform/chrome: cros_kbd_led_backlight: Remove OF match
After applying 4c03a44 ("arm64: dts: mediatek: mt8195-cherry: Remove keyboard-backlight node"), there are no users for using the OF match. Instead, the device is added via drivers/mfd/cros_ec_dev.c by 970c3a6 ("mfd: cros_ec: Register keyboard backlight subdevice"). Remove the OF match. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Tzung-Bi Shih <[email protected]>
1 parent dce2f5b commit 3a1d61d

File tree

1 file changed

+11
-51
lines changed

1 file changed

+11
-51
lines changed

drivers/platform/chrome/cros_kbd_led_backlight.c

Lines changed: 11 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,17 @@ static const struct keyboard_led_drvdata keyboard_led_drvdata_acpi = {
121121

122122
#endif /* CONFIG_ACPI */
123123

124-
#if IS_ENABLED(CONFIG_CROS_EC)
124+
#if IS_ENABLED(CONFIG_MFD_CROS_EC_DEV)
125+
static int keyboard_led_init_ec_pwm_mfd(struct platform_device *pdev)
126+
{
127+
struct cros_ec_dev *ec_dev = dev_get_drvdata(pdev->dev.parent);
128+
struct cros_ec_device *cros_ec = ec_dev->ec_dev;
129+
struct keyboard_led *keyboard_led = platform_get_drvdata(pdev);
130+
131+
keyboard_led->ec = cros_ec;
132+
133+
return 0;
134+
}
125135

126136
static int
127137
keyboard_led_set_brightness_ec_pwm(struct led_classdev *cdev,
@@ -169,44 +179,6 @@ keyboard_led_get_brightness_ec_pwm(struct led_classdev *cdev)
169179
return resp->percent;
170180
}
171181

172-
static int keyboard_led_init_ec_pwm(struct platform_device *pdev)
173-
{
174-
struct keyboard_led *keyboard_led = platform_get_drvdata(pdev);
175-
176-
keyboard_led->ec = dev_get_drvdata(pdev->dev.parent);
177-
if (!keyboard_led->ec) {
178-
dev_err(&pdev->dev, "no parent EC device\n");
179-
return -EINVAL;
180-
}
181-
182-
return 0;
183-
}
184-
185-
static const __maybe_unused struct keyboard_led_drvdata keyboard_led_drvdata_ec_pwm = {
186-
.init = keyboard_led_init_ec_pwm,
187-
.brightness_set_blocking = keyboard_led_set_brightness_ec_pwm,
188-
.brightness_get = keyboard_led_get_brightness_ec_pwm,
189-
.max_brightness = KEYBOARD_BACKLIGHT_MAX,
190-
};
191-
192-
#else /* IS_ENABLED(CONFIG_CROS_EC) */
193-
194-
static const __maybe_unused struct keyboard_led_drvdata keyboard_led_drvdata_ec_pwm = {};
195-
196-
#endif /* IS_ENABLED(CONFIG_CROS_EC) */
197-
198-
#if IS_ENABLED(CONFIG_MFD_CROS_EC_DEV)
199-
static int keyboard_led_init_ec_pwm_mfd(struct platform_device *pdev)
200-
{
201-
struct cros_ec_dev *ec_dev = dev_get_drvdata(pdev->dev.parent);
202-
struct cros_ec_device *cros_ec = ec_dev->ec_dev;
203-
struct keyboard_led *keyboard_led = platform_get_drvdata(pdev);
204-
205-
keyboard_led->ec = cros_ec;
206-
207-
return 0;
208-
}
209-
210182
static const struct keyboard_led_drvdata keyboard_led_drvdata_ec_pwm_mfd = {
211183
.init = keyboard_led_init_ec_pwm_mfd,
212184
.brightness_set_blocking = keyboard_led_set_brightness_ec_pwm,
@@ -270,17 +242,6 @@ static const struct acpi_device_id keyboard_led_acpi_match[] = {
270242
MODULE_DEVICE_TABLE(acpi, keyboard_led_acpi_match);
271243
#endif
272244

273-
#ifdef CONFIG_OF
274-
static const struct of_device_id keyboard_led_of_match[] = {
275-
{
276-
.compatible = "google,cros-kbd-led-backlight",
277-
.data = &keyboard_led_drvdata_ec_pwm,
278-
},
279-
{}
280-
};
281-
MODULE_DEVICE_TABLE(of, keyboard_led_of_match);
282-
#endif
283-
284245
static const struct platform_device_id keyboard_led_id[] = {
285246
{ "cros-keyboard-leds", 0 },
286247
{}
@@ -291,7 +252,6 @@ static struct platform_driver keyboard_led_driver = {
291252
.driver = {
292253
.name = "cros-keyboard-leds",
293254
.acpi_match_table = ACPI_PTR(keyboard_led_acpi_match),
294-
.of_match_table = of_match_ptr(keyboard_led_of_match),
295255
},
296256
.probe = keyboard_led_probe,
297257
.id_table = keyboard_led_id,

0 commit comments

Comments
 (0)