diff options
Diffstat (limited to 'drivers/mfd/mc13xxx-i2c.c')
| -rw-r--r-- | drivers/mfd/mc13xxx-i2c.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/drivers/mfd/mc13xxx-i2c.c b/drivers/mfd/mc13xxx-i2c.c index 67e4c9aa7d18..6bc0e755ba34 100644 --- a/drivers/mfd/mc13xxx-i2c.c +++ b/drivers/mfd/mc13xxx-i2c.c @@ -1,10 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2009-2010 Creative Product Design * Marc Reilly marc@cpdesign.com.au - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License version 2 as published by the - * Free Software Foundation. */ #include <linux/slab.h> @@ -14,7 +11,6 @@ #include <linux/mfd/mc13xxx.h> #include <linux/of.h> #include <linux/of_device.h> -#include <linux/of_gpio.h> #include <linux/i2c.h> #include <linux/err.h> @@ -55,8 +51,7 @@ static const struct regmap_config mc13xxx_regmap_i2c_config = { .cache_type = REGCACHE_NONE, }; -static int mc13xxx_i2c_probe(struct i2c_client *client, - const struct i2c_device_id *id) +static int mc13xxx_i2c_probe(struct i2c_client *client) { struct mc13xxx *mc13xxx; int ret; @@ -77,20 +72,14 @@ static int mc13xxx_i2c_probe(struct i2c_client *client, return ret; } - if (client->dev.of_node) { - const struct of_device_id *of_id = - of_match_device(mc13xxx_dt_ids, &client->dev); - mc13xxx->variant = of_id->data; - } else { - mc13xxx->variant = (void *)id->driver_data; - } + mc13xxx->variant = i2c_get_match_data(client); return mc13xxx_common_init(&client->dev); } -static int mc13xxx_i2c_remove(struct i2c_client *client) +static void mc13xxx_i2c_remove(struct i2c_client *client) { - return mc13xxx_common_exit(&client->dev); + mc13xxx_common_exit(&client->dev); } static struct i2c_driver mc13xxx_i2c_driver = { |
