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

Configure Feed

Select the types of activity you want to include in your feed.

iio: adc: max1363: Use i2c_get_match_data()

Replace device_get_match_data() and i2c_match_id() by
i2c_get_match_data() by making similar I2C and DT-based matching
table.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20230812072419.42645-1-biju.das.jz@bp.renesas.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Biju Das and committed by
Jonathan Cameron
9f6001e3 72d36539

+45 -42
+45 -42
drivers/iio/adc/max1363.c
··· 1599 1599 if (ret) 1600 1600 return ret; 1601 1601 1602 - st->chip_info = device_get_match_data(&client->dev); 1603 - if (!st->chip_info) 1604 - st->chip_info = &max1363_chip_info_tbl[id->driver_data]; 1602 + st->chip_info = i2c_get_match_data(client); 1605 1603 st->client = client; 1606 1604 1607 1605 st->vref_uv = st->chip_info->int_vref_mv * 1000; ··· 1667 1669 return devm_iio_device_register(&client->dev, indio_dev); 1668 1670 } 1669 1671 1672 + #define MAX1363_ID_TABLE(_name, cfg) { \ 1673 + .name = _name, \ 1674 + .driver_data = (kernel_ulong_t)&max1363_chip_info_tbl[cfg], \ 1675 + } 1676 + 1670 1677 static const struct i2c_device_id max1363_id[] = { 1671 - { "max1361", max1361 }, 1672 - { "max1362", max1362 }, 1673 - { "max1363", max1363 }, 1674 - { "max1364", max1364 }, 1675 - { "max1036", max1036 }, 1676 - { "max1037", max1037 }, 1677 - { "max1038", max1038 }, 1678 - { "max1039", max1039 }, 1679 - { "max1136", max1136 }, 1680 - { "max1137", max1137 }, 1681 - { "max1138", max1138 }, 1682 - { "max1139", max1139 }, 1683 - { "max1236", max1236 }, 1684 - { "max1237", max1237 }, 1685 - { "max1238", max1238 }, 1686 - { "max1239", max1239 }, 1687 - { "max11600", max11600 }, 1688 - { "max11601", max11601 }, 1689 - { "max11602", max11602 }, 1690 - { "max11603", max11603 }, 1691 - { "max11604", max11604 }, 1692 - { "max11605", max11605 }, 1693 - { "max11606", max11606 }, 1694 - { "max11607", max11607 }, 1695 - { "max11608", max11608 }, 1696 - { "max11609", max11609 }, 1697 - { "max11610", max11610 }, 1698 - { "max11611", max11611 }, 1699 - { "max11612", max11612 }, 1700 - { "max11613", max11613 }, 1701 - { "max11614", max11614 }, 1702 - { "max11615", max11615 }, 1703 - { "max11616", max11616 }, 1704 - { "max11617", max11617 }, 1705 - { "max11644", max11644 }, 1706 - { "max11645", max11645 }, 1707 - { "max11646", max11646 }, 1708 - { "max11647", max11647 }, 1709 - {} 1678 + MAX1363_ID_TABLE("max1361", max1361), 1679 + MAX1363_ID_TABLE("max1362", max1362), 1680 + MAX1363_ID_TABLE("max1363", max1363), 1681 + MAX1363_ID_TABLE("max1364", max1364), 1682 + MAX1363_ID_TABLE("max1036", max1036), 1683 + MAX1363_ID_TABLE("max1037", max1037), 1684 + MAX1363_ID_TABLE("max1038", max1038), 1685 + MAX1363_ID_TABLE("max1039", max1039), 1686 + MAX1363_ID_TABLE("max1136", max1136), 1687 + MAX1363_ID_TABLE("max1137", max1137), 1688 + MAX1363_ID_TABLE("max1138", max1138), 1689 + MAX1363_ID_TABLE("max1139", max1139), 1690 + MAX1363_ID_TABLE("max1236", max1236), 1691 + MAX1363_ID_TABLE("max1237", max1237), 1692 + MAX1363_ID_TABLE("max1238", max1238), 1693 + MAX1363_ID_TABLE("max1239", max1239), 1694 + MAX1363_ID_TABLE("max11600", max11600), 1695 + MAX1363_ID_TABLE("max11601", max11601), 1696 + MAX1363_ID_TABLE("max11602", max11602), 1697 + MAX1363_ID_TABLE("max11603", max11603), 1698 + MAX1363_ID_TABLE("max11604", max11604), 1699 + MAX1363_ID_TABLE("max11605", max11605), 1700 + MAX1363_ID_TABLE("max11606", max11606), 1701 + MAX1363_ID_TABLE("max11607", max11607), 1702 + MAX1363_ID_TABLE("max11608", max11608), 1703 + MAX1363_ID_TABLE("max11609", max11609), 1704 + MAX1363_ID_TABLE("max11610", max11610), 1705 + MAX1363_ID_TABLE("max11611", max11611), 1706 + MAX1363_ID_TABLE("max11612", max11612), 1707 + MAX1363_ID_TABLE("max11613", max11613), 1708 + MAX1363_ID_TABLE("max11614", max11614), 1709 + MAX1363_ID_TABLE("max11615", max11615), 1710 + MAX1363_ID_TABLE("max11616", max11616), 1711 + MAX1363_ID_TABLE("max11617", max11617), 1712 + MAX1363_ID_TABLE("max11644", max11644), 1713 + MAX1363_ID_TABLE("max11645", max11645), 1714 + MAX1363_ID_TABLE("max11646", max11646), 1715 + MAX1363_ID_TABLE("max11647", max11647), 1716 + { /* sentinel */ } 1710 1717 }; 1711 1718 1712 1719 MODULE_DEVICE_TABLE(i2c, max1363_id);