Skip to content

Commit b3c3a19

Browse files
robherringsre
authored andcommitted
power: supply: cpcap: Drop non-DT driver matching
Only DT based probing is used for the Motorola CPCAP charger driver, so drop the !CONFIG_OF parts and redundant of_match_device() call. Signed-off-by: Rob Herring <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 3c693ac commit b3c3a19

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

drivers/power/supply/cpcap-charger.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
#include <linux/err.h>
1818
#include <linux/interrupt.h>
1919
#include <linux/notifier.h>
20-
#include <linux/of.h>
21-
#include <linux/of_platform.h>
20+
#include <linux/mod_devicetable.h>
2221
#include <linux/platform_device.h>
2322
#include <linux/power_supply.h>
2423
#include <linux/regmap.h>
@@ -865,28 +864,20 @@ static const struct power_supply_desc cpcap_charger_usb_desc = {
865864
.property_is_writeable = cpcap_charger_property_is_writeable,
866865
};
867866

868-
#ifdef CONFIG_OF
869867
static const struct of_device_id cpcap_charger_id_table[] = {
870868
{
871869
.compatible = "motorola,mapphone-cpcap-charger",
872870
},
873871
{},
874872
};
875873
MODULE_DEVICE_TABLE(of, cpcap_charger_id_table);
876-
#endif
877874

878875
static int cpcap_charger_probe(struct platform_device *pdev)
879876
{
880877
struct cpcap_charger_ddata *ddata;
881-
const struct of_device_id *of_id;
882878
struct power_supply_config psy_cfg = {};
883879
int error;
884880

885-
of_id = of_match_device(of_match_ptr(cpcap_charger_id_table),
886-
&pdev->dev);
887-
if (!of_id)
888-
return -EINVAL;
889-
890881
ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL);
891882
if (!ddata)
892883
return -ENOMEM;
@@ -975,7 +966,7 @@ static struct platform_driver cpcap_charger_driver = {
975966
.probe = cpcap_charger_probe,
976967
.driver = {
977968
.name = "cpcap-charger",
978-
.of_match_table = of_match_ptr(cpcap_charger_id_table),
969+
.of_match_table = cpcap_charger_id_table,
979970
},
980971
.shutdown = cpcap_charger_shutdown,
981972
.remove_new = cpcap_charger_remove,

0 commit comments

Comments
 (0)