Skip to content

Commit 7ebfd88

Browse files
hormswsakernel
authored andcommitted
i2c: mchp-pci1xxxx: Avoid cast to incompatible function type
Rather than casting pci1xxxx_i2c_shutdown to an incompatible function type, update the type to match that expected by __devm_add_action. Reported by clang-16 with W-1: .../i2c-mchp-pci1xxxx.c:1159:29: error: cast from 'void (*)(struct pci1xxxx_i2c *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict] ret = devm_add_action(dev, (void (*)(void *))pci1xxxx_i2c_shutdown, i2c); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./include/linux/device.h:251:29: note: expanded from macro 'devm_add_action' __devm_add_action(release, action, data, #action) ^~~~~~ No functional change intended. Compile tested only. Signed-off-by: Simon Horman <horms@kernel.org> Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Reviewed-by: Tharun Kumar P<tharunkumar.pasumarthi@microchip.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
1 parent 8110bf2 commit 7ebfd88

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/i2c/busses/i2c-mchp-pci1xxxx.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,8 +1118,10 @@ static int pci1xxxx_i2c_resume(struct device *dev)
11181118
static DEFINE_SIMPLE_DEV_PM_OPS(pci1xxxx_i2c_pm_ops, pci1xxxx_i2c_suspend,
11191119
pci1xxxx_i2c_resume);
11201120

1121-
static void pci1xxxx_i2c_shutdown(struct pci1xxxx_i2c *i2c)
1121+
static void pci1xxxx_i2c_shutdown(void *data)
11221122
{
1123+
struct pci1xxxx_i2c *i2c = data;
1124+
11231125
pci1xxxx_i2c_config_padctrl(i2c, false);
11241126
pci1xxxx_i2c_configure_core_reg(i2c, false);
11251127
}
@@ -1156,7 +1158,7 @@ static int pci1xxxx_i2c_probe_pci(struct pci_dev *pdev,
11561158
init_completion(&i2c->i2c_xfer_done);
11571159
pci1xxxx_i2c_init(i2c);
11581160

1159-
ret = devm_add_action(dev, (void (*)(void *))pci1xxxx_i2c_shutdown, i2c);
1161+
ret = devm_add_action(dev, pci1xxxx_i2c_shutdown, i2c);
11601162
if (ret)
11611163
return ret;
11621164

0 commit comments

Comments
 (0)