mirror of
https://github.com/torvalds/linux.git
synced 2025-04-09 14:45:27 +00:00
i2c: iproc: Refactor prototype and remove redundant error checks
The bcm_iproc_i2c_init() always returns 0. As a result, there is no need to check its return value or handle errors. This patch changes the prototype of bcm_iproc_i2c_init() to return void and removes the redundant error handling code after calls to bcm_iproc_i2c_init() in both the bcm_iproc_i2c_probe() and bcm_iproc_i2c_resume(). Signed-off-by: Wentao Liang <vulab@iscas.ac.cn> Acked-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Acked-by: Ray Jui <ray.jui@broadcom.com> Link: https://lore.kernel.org/r/20250121084818.2719-1-vulab@iscas.ac.cn Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
This commit is contained in:
parent
a815975cba
commit
39f8d63804
@ -678,7 +678,7 @@ static irqreturn_t bcm_iproc_i2c_isr(int irq, void *data)
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static int bcm_iproc_i2c_init(struct bcm_iproc_i2c_dev *iproc_i2c)
|
||||
static void bcm_iproc_i2c_init(struct bcm_iproc_i2c_dev *iproc_i2c)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
@ -706,8 +706,6 @@ static int bcm_iproc_i2c_init(struct bcm_iproc_i2c_dev *iproc_i2c)
|
||||
|
||||
/* clear all pending interrupts */
|
||||
iproc_i2c_wr_reg(iproc_i2c, IS_OFFSET, 0xffffffff);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void bcm_iproc_i2c_enable_disable(struct bcm_iproc_i2c_dev *iproc_i2c,
|
||||
@ -1081,9 +1079,7 @@ static int bcm_iproc_i2c_probe(struct platform_device *pdev)
|
||||
bcm_iproc_algo.unreg_slave = NULL;
|
||||
}
|
||||
|
||||
ret = bcm_iproc_i2c_init(iproc_i2c);
|
||||
if (ret)
|
||||
return ret;
|
||||
bcm_iproc_i2c_init(iproc_i2c);
|
||||
|
||||
ret = bcm_iproc_i2c_cfg_speed(iproc_i2c);
|
||||
if (ret)
|
||||
@ -1162,16 +1158,13 @@ static int bcm_iproc_i2c_suspend(struct device *dev)
|
||||
static int bcm_iproc_i2c_resume(struct device *dev)
|
||||
{
|
||||
struct bcm_iproc_i2c_dev *iproc_i2c = dev_get_drvdata(dev);
|
||||
int ret;
|
||||
u32 val;
|
||||
|
||||
/*
|
||||
* Power domain could have been shut off completely in system deep
|
||||
* sleep, so re-initialize the block here
|
||||
*/
|
||||
ret = bcm_iproc_i2c_init(iproc_i2c);
|
||||
if (ret)
|
||||
return ret;
|
||||
bcm_iproc_i2c_init(iproc_i2c);
|
||||
|
||||
/* configure to the desired bus speed */
|
||||
val = iproc_i2c_rd_reg(iproc_i2c, TIM_CFG_OFFSET);
|
||||
|
Loading…
x
Reference in New Issue
Block a user