Skip to content

Commit e6fc7ef

Browse files
committed
auxdisplay: ht16k33: Make use of i2c_get_match_data()
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>
1 parent e3a5eb4 commit e6fc7ef

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

drivers/auxdisplay/ht16k33.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,6 @@ static int ht16k33_seg_probe(struct device *dev, struct ht16k33_priv *priv,
657657
static int ht16k33_probe(struct i2c_client *client)
658658
{
659659
struct device *dev = &client->dev;
660-
const struct of_device_id *id;
661660
struct ht16k33_priv *priv;
662661
uint32_t dft_brightness;
663662
int err;
@@ -672,9 +671,8 @@ static int ht16k33_probe(struct i2c_client *client)
672671
return -ENOMEM;
673672

674673
priv->client = client;
675-
id = i2c_of_match_device(dev->driver->of_match_table, client);
676-
if (id)
677-
priv->type = (uintptr_t)id->data;
674+
priv->type = (uintptr_t)i2c_get_match_data(client);
675+
678676
i2c_set_clientdata(client, priv);
679677

680678
err = ht16k33_initialize(priv);
@@ -747,7 +745,9 @@ static void ht16k33_remove(struct i2c_client *client)
747745
}
748746

749747
static const struct i2c_device_id ht16k33_i2c_match[] = {
750-
{ "ht16k33" },
748+
{ "3108", DISP_QUAD_7SEG },
749+
{ "3130", DISP_QUAD_14SEG },
750+
{ "ht16k33", DISP_MATRIX },
751751
{ }
752752
};
753753
MODULE_DEVICE_TABLE(i2c, ht16k33_i2c_match);

0 commit comments

Comments
 (0)