Skip to content

Commit

Permalink
mfd: intel_soc_pmic_crc: Convert to use i2c_get/set_clientdata()
Browse files Browse the repository at this point in the history
We have the specific helpers for I2C device to set and get its driver data.
Convert driver to use them instead of open coded variants.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20220801114211.36267-5-andriy.shevchenko@linux.intel.com
  • Loading branch information
Andy Shevchenko authored and Lee Jones committed Aug 15, 2022
1 parent 20d1cb8 commit a819fb9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mfd/intel_soc_pmic_crc.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ static int intel_soc_pmic_i2c_probe(struct i2c_client *i2c,
if (!pmic)
return -ENOMEM;

dev_set_drvdata(dev, pmic);
i2c_set_clientdata(i2c, pmic);

pmic->regmap = devm_regmap_init_i2c(i2c, config->regmap_config);
if (IS_ERR(pmic->regmap))
Expand Down Expand Up @@ -227,7 +227,7 @@ static int intel_soc_pmic_i2c_remove(struct i2c_client *i2c)

static void intel_soc_pmic_shutdown(struct i2c_client *i2c)
{
struct intel_soc_pmic *pmic = dev_get_drvdata(&i2c->dev);
struct intel_soc_pmic *pmic = i2c_get_clientdata(i2c);

disable_irq(pmic->irq);

Expand Down

0 comments on commit a819fb9

Please sign in to comment.