Skip to content

Commit

Permalink
leds: spi-byte: Move OF ID table closer to their user
Browse files Browse the repository at this point in the history
There is no code that uses ID table directly, except the
struct device_driver at the end of the file. Hence, move
table closer to its user. It's always possible to access
them via a pointer.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240606173037.3091598-7-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
  • Loading branch information
andy-shev authored and lag-linaro committed Jun 26, 2024
1 parent 133f941 commit 25458b2
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions drivers/leds/leds-spi-byte.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,6 @@ static const struct spi_byte_chipdef ubnt_acb_spi_led_cdef = {
.max_value = 0x3F,
};

static const struct of_device_id spi_byte_dt_ids[] = {
{ .compatible = "ubnt,acb-spi-led", .data = &ubnt_acb_spi_led_cdef },
{},
};

MODULE_DEVICE_TABLE(of, spi_byte_dt_ids);

static int spi_byte_brightness_set_blocking(struct led_classdev *dev,
enum led_brightness brightness)
{
Expand Down Expand Up @@ -122,6 +115,12 @@ static int spi_byte_probe(struct spi_device *spi)
return devm_led_classdev_register_ext(dev, &led->ldev, &init_data);
}

static const struct of_device_id spi_byte_dt_ids[] = {
{ .compatible = "ubnt,acb-spi-led", .data = &ubnt_acb_spi_led_cdef },
{}
};
MODULE_DEVICE_TABLE(of, spi_byte_dt_ids);

static struct spi_driver spi_byte_driver = {
.probe = spi_byte_probe,
.driver = {
Expand Down

0 comments on commit 25458b2

Please sign in to comment.