Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

platform/chrome: cros_kbd_led_backlight: Remove OF match

After applying 4c03a44e2668 ("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
970c3a6b7aa3 ("mfd: cros_ec: Register keyboard backlight subdevice").

Remove the OF match.

Link: https://lore.kernel.org/r/20241206031405.1711996-2-tzungbi@kernel.org
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>

+11 -51
+11 -51
drivers/platform/chrome/cros_kbd_led_backlight.c
··· 121 121 122 122 #endif /* CONFIG_ACPI */ 123 123 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 + } 125 135 126 136 static int 127 137 keyboard_led_set_brightness_ec_pwm(struct led_classdev *cdev, ··· 177 167 return ret; 178 168 179 169 return resp->percent; 180 - } 181 - 182 - static int keyboard_led_init_ec_pwm(struct platform_device *pdev) 183 - { 184 - struct keyboard_led *keyboard_led = platform_get_drvdata(pdev); 185 - 186 - keyboard_led->ec = dev_get_drvdata(pdev->dev.parent); 187 - if (!keyboard_led->ec) { 188 - dev_err(&pdev->dev, "no parent EC device\n"); 189 - return -EINVAL; 190 - } 191 - 192 - return 0; 193 - } 194 - 195 - static const __maybe_unused struct keyboard_led_drvdata keyboard_led_drvdata_ec_pwm = { 196 - .init = keyboard_led_init_ec_pwm, 197 - .brightness_set_blocking = keyboard_led_set_brightness_ec_pwm, 198 - .brightness_get = keyboard_led_get_brightness_ec_pwm, 199 - .max_brightness = KEYBOARD_BACKLIGHT_MAX, 200 - }; 201 - 202 - #else /* IS_ENABLED(CONFIG_CROS_EC) */ 203 - 204 - static const __maybe_unused struct keyboard_led_drvdata keyboard_led_drvdata_ec_pwm = {}; 205 - 206 - #endif /* IS_ENABLED(CONFIG_CROS_EC) */ 207 - 208 - #if IS_ENABLED(CONFIG_MFD_CROS_EC_DEV) 209 - static int keyboard_led_init_ec_pwm_mfd(struct platform_device *pdev) 210 - { 211 - struct cros_ec_dev *ec_dev = dev_get_drvdata(pdev->dev.parent); 212 - struct cros_ec_device *cros_ec = ec_dev->ec_dev; 213 - struct keyboard_led *keyboard_led = platform_get_drvdata(pdev); 214 - 215 - keyboard_led->ec = cros_ec; 216 - 217 - return 0; 218 170 } 219 171 220 172 static const struct keyboard_led_drvdata keyboard_led_drvdata_ec_pwm_mfd = { ··· 242 270 MODULE_DEVICE_TABLE(acpi, keyboard_led_acpi_match); 243 271 #endif 244 272 245 - #ifdef CONFIG_OF 246 - static const struct of_device_id keyboard_led_of_match[] = { 247 - { 248 - .compatible = "google,cros-kbd-led-backlight", 249 - .data = &keyboard_led_drvdata_ec_pwm, 250 - }, 251 - {} 252 - }; 253 - MODULE_DEVICE_TABLE(of, keyboard_led_of_match); 254 - #endif 255 - 256 273 static const struct platform_device_id keyboard_led_id[] = { 257 274 { "cros-keyboard-leds", 0 }, 258 275 {} ··· 252 291 .driver = { 253 292 .name = "cros-keyboard-leds", 254 293 .acpi_match_table = ACPI_PTR(keyboard_led_acpi_match), 255 - .of_match_table = of_match_ptr(keyboard_led_of_match), 256 294 }, 257 295 .probe = keyboard_led_probe, 258 296 .id_table = keyboard_led_id,