]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
auxdisplay: ht16k33: Make use of i2c_get_match_data()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 30 Sep 2024 13:26:42 +0000 (16:26 +0300)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 3 Oct 2024 10:07:09 +0000 (13:07 +0300)
Get matching data in one step by switching to use i2c_get_match_data().
As a positive side effect the I²C ID table is in sync of OF one.

Reviewed-by: Robin van der Gracht <robin@protonic.nl>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/auxdisplay/ht16k33.c

index b00012a556fb39226fafef63490e845bc725c2ab..96ad9e972bd737f6090e80295288b11e0fbffe97 100644 (file)
@@ -657,7 +657,6 @@ static int ht16k33_seg_probe(struct device *dev, struct ht16k33_priv *priv,
 static int ht16k33_probe(struct i2c_client *client)
 {
        struct device *dev = &client->dev;
-       const struct of_device_id *id;
        struct ht16k33_priv *priv;
        uint32_t dft_brightness;
        int err;
@@ -672,9 +671,8 @@ static int ht16k33_probe(struct i2c_client *client)
                return -ENOMEM;
 
        priv->client = client;
-       id = i2c_of_match_device(dev->driver->of_match_table, client);
-       if (id)
-               priv->type = (uintptr_t)id->data;
+       priv->type = (uintptr_t)i2c_get_match_data(client);
+
        i2c_set_clientdata(client, priv);
 
        err = ht16k33_initialize(priv);
@@ -747,7 +745,9 @@ static void ht16k33_remove(struct i2c_client *client)
 }
 
 static const struct i2c_device_id ht16k33_i2c_match[] = {
-       { "ht16k33" },
+       { "3108", DISP_QUAD_7SEG },
+       { "3130", DISP_QUAD_14SEG },
+       { "ht16k33", DISP_MATRIX },
        { }
 };
 MODULE_DEVICE_TABLE(i2c, ht16k33_i2c_match);