Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i2c: designware: Remove ->disable() callback

Commit 90312351fd1e ("i2c: designware: MASTER mode as separated driver")
introduced ->disable() callback but there is no real use for it. Both
i2c-designware-master.c and i2c-designware-slave.c set it to the same
i2c_dw_disable() and scope is inside the same kernel module.

That said, replace the callback by explicitly calling the i2c_dw_disable().

Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>

authored by

Andy Shevchenko and committed by
Andi Shyti
bc07fb41 fd57a332

+8 -10
+1
drivers/i2c/busses/i2c-designware-common.c
··· 734 734 735 735 i2c_dw_release_lock(dev); 736 736 } 737 + EXPORT_SYMBOL_GPL(i2c_dw_disable); 737 738 738 739 MODULE_DESCRIPTION("Synopsys DesignWare I2C bus adapter core"); 739 740 MODULE_LICENSE("GPL");
+1 -3
drivers/i2c/busses/i2c-designware-core.h
··· 237 237 * @semaphore_idx: Index of table with semaphore type attached to the bus. It's 238 238 * -1 if there is no semaphore. 239 239 * @shared_with_punit: true if this bus is shared with the SoCs PUNIT 240 - * @disable: function to disable the controller 241 240 * @init: function to initialize the I2C hardware 242 241 * @set_sda_hold_time: callback to retrieve IP specific SDA hold timing 243 242 * @mode: operation mode - DW_IC_MASTER or DW_IC_SLAVE ··· 294 295 void (*release_lock)(void); 295 296 int semaphore_idx; 296 297 bool shared_with_punit; 297 - void (*disable)(struct dw_i2c_dev *dev); 298 298 int (*init)(struct dw_i2c_dev *dev); 299 299 int (*set_sda_hold_time)(struct dw_i2c_dev *dev); 300 300 int mode; ··· 340 342 int i2c_dw_handle_tx_abort(struct dw_i2c_dev *dev); 341 343 int i2c_dw_set_fifo_size(struct dw_i2c_dev *dev); 342 344 u32 i2c_dw_func(struct i2c_adapter *adap); 343 - void i2c_dw_disable(struct dw_i2c_dev *dev); 344 345 345 346 static inline void __i2c_dw_enable(struct dw_i2c_dev *dev) 346 347 { ··· 372 375 } 373 376 374 377 void __i2c_dw_disable(struct dw_i2c_dev *dev); 378 + void i2c_dw_disable(struct dw_i2c_dev *dev); 375 379 376 380 extern void i2c_dw_configure_master(struct dw_i2c_dev *dev); 377 381 extern int i2c_dw_probe_master(struct dw_i2c_dev *dev);
-1
drivers/i2c/busses/i2c-designware-master.c
··· 949 949 init_completion(&dev->cmd_complete); 950 950 951 951 dev->init = i2c_dw_init_master; 952 - dev->disable = i2c_dw_disable; 953 952 954 953 ret = i2c_dw_init_regmap(dev); 955 954 if (ret)
+3 -2
drivers/i2c/busses/i2c-designware-pcidrv.c
··· 198 198 { 199 199 struct dw_i2c_dev *i_dev = dev_get_drvdata(dev); 200 200 201 - i_dev->disable(i_dev); 201 + i2c_dw_disable(i_dev); 202 202 return 0; 203 203 } 204 204 ··· 339 339 { 340 340 struct dw_i2c_dev *dev = pci_get_drvdata(pdev); 341 341 342 - dev->disable(dev); 342 + i2c_dw_disable(dev); 343 + 343 344 pm_runtime_forbid(&pdev->dev); 344 345 pm_runtime_get_noresume(&pdev->dev); 345 346
+2 -2
drivers/i2c/busses/i2c-designware-platdrv.c
··· 328 328 329 329 i2c_del_adapter(&dev->adapter); 330 330 331 - dev->disable(dev); 331 + i2c_dw_disable(dev); 332 332 333 333 pm_runtime_dont_use_autosuspend(&pdev->dev); 334 334 pm_runtime_put_sync(&pdev->dev); ··· 357 357 if (i_dev->shared_with_punit) 358 358 return 0; 359 359 360 - i_dev->disable(i_dev); 360 + i2c_dw_disable(i_dev); 361 361 i2c_dw_prepare_clk(i_dev, false); 362 362 363 363 return 0;
+1 -2
drivers/i2c/busses/i2c-designware-slave.c
··· 90 90 struct dw_i2c_dev *dev = i2c_get_adapdata(slave->adapter); 91 91 92 92 regmap_write(dev->map, DW_IC_INTR_MASK, 0); 93 - dev->disable(dev); 93 + i2c_dw_disable(dev); 94 94 synchronize_irq(dev->irq); 95 95 dev->slave = NULL; 96 96 pm_runtime_put(dev->dev); ··· 237 237 int ret; 238 238 239 239 dev->init = i2c_dw_init_slave; 240 - dev->disable = i2c_dw_disable; 241 240 242 241 ret = i2c_dw_init_regmap(dev); 243 242 if (ret)