diff options
author | Sven Peter <sven@svenpeter.dev> | 2021-10-08 18:35:30 +0200 |
---|---|---|
committer | Wolfram Sang <wsa@kernel.org> | 2021-10-11 11:45:35 +0200 |
commit | a2c34bfd2c580f1732fc60e2af4aa439dde285be (patch) | |
tree | d6a1b88e760c75c8ba03ee118c9d70de418be930 /drivers/i2c/busses/i2c-pasemi-core.c | |
parent | fd664ab2319fb89cba5a522995e806eb26748af6 (diff) | |
download | linux-a2c34bfd2c580f1732fc60e2af4aa439dde285be.tar.gz linux-a2c34bfd2c580f1732fc60e2af4aa439dde285be.tar.bz2 linux-a2c34bfd2c580f1732fc60e2af4aa439dde285be.zip |
i2c: pasemi: Refactor _probe to use devm_*
Using managed device resources means there's nothing left to be done in
pasemi_smb_pci_remove and also allows to remove base and size from
struct pasemi_smbus.
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sven Peter <sven@svenpeter.dev>
Acked-by: Olof Johansson <olof@lixom.net>
Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-pasemi-core.c')
-rw-r--r-- | drivers/i2c/busses/i2c-pasemi-core.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/i2c/busses/i2c-pasemi-core.c b/drivers/i2c/busses/i2c-pasemi-core.c index 9fb8fac53f2b..3d87b64dd9f7 100644 --- a/drivers/i2c/busses/i2c-pasemi-core.c +++ b/drivers/i2c/busses/i2c-pasemi-core.c @@ -41,8 +41,7 @@ static inline void reg_write(struct pasemi_smbus *smbus, int reg, int val) { - dev_dbg(smbus->dev, "smbus write reg %lx val %08x\n", - smbus->base + reg, val); + dev_dbg(smbus->dev, "smbus write reg %x val %08x\n", reg, val); iowrite32(val, smbus->ioaddr + reg); } @@ -50,8 +49,7 @@ static inline int reg_read(struct pasemi_smbus *smbus, int reg) { int ret; ret = ioread32(smbus->ioaddr + reg); - dev_dbg(smbus->dev, "smbus read reg %lx val %08x\n", - smbus->base + reg, ret); + dev_dbg(smbus->dev, "smbus read reg %x val %08x\n", reg, ret); return ret; } @@ -339,7 +337,7 @@ int pasemi_i2c_common_probe(struct pasemi_smbus *smbus) pasemi_reset(smbus); - error = i2c_add_adapter(&smbus->adapter); + error = devm_i2c_add_adapter(smbus->dev, &smbus->adapter); if (error) return error; |