Skip to content

Commit b698377

Browse files
abdurrahman-nexthopAndi Shyti
authored andcommitted
i2c: xiic: cosmetic cleanup
Re-use dev pointer instead of referencing &pdev->dev everywhere. Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20260223-i2c-xiic-v12-4-b6c9ce4e4f3c@nexthop.ai
1 parent b621a96 commit b698377

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

drivers/i2c/busses/i2c-xiic.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,7 +1430,7 @@ static int xiic_i2c_probe(struct platform_device *pdev)
14301430
u8 i;
14311431
u32 sr;
14321432

1433-
i2c = devm_kzalloc(&pdev->dev, sizeof(*i2c), GFP_KERNEL);
1433+
i2c = devm_kzalloc(dev, sizeof(*i2c), GFP_KERNEL);
14341434
if (!i2c)
14351435
return -ENOMEM;
14361436

@@ -1446,7 +1446,7 @@ static int xiic_i2c_probe(struct platform_device *pdev)
14461446
if (irq < 0)
14471447
return irq;
14481448

1449-
pdata = dev_get_platdata(&pdev->dev);
1449+
pdata = dev_get_platdata(dev);
14501450

14511451
/* hook up driver to tree */
14521452
platform_set_drvdata(pdev, i2c);
@@ -1468,9 +1468,10 @@ static int xiic_i2c_probe(struct platform_device *pdev)
14681468
return dev_err_probe(&pdev->dev, PTR_ERR(i2c->clk),
14691469
"failed to enable input clock.\n");
14701470

1471-
i2c->dev = &pdev->dev;
1472-
pm_runtime_set_autosuspend_delay(i2c->dev, XIIC_PM_TIMEOUT);
1473-
pm_runtime_use_autosuspend(i2c->dev);
1471+
i2c->dev = dev;
1472+
1473+
pm_runtime_set_autosuspend_delay(dev, XIIC_PM_TIMEOUT);
1474+
pm_runtime_use_autosuspend(dev);
14741475
ret = devm_pm_runtime_set_active_enabled(dev);
14751476
if (ret)
14761477
return ret;
@@ -1482,9 +1483,8 @@ static int xiic_i2c_probe(struct platform_device *pdev)
14821483
if (ret || i2c->i2c_clk > I2C_MAX_FAST_MODE_PLUS_FREQ)
14831484
i2c->i2c_clk = 0;
14841485

1485-
ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
1486-
xiic_process, IRQF_ONESHOT,
1487-
pdev->name, i2c);
1486+
ret = devm_request_threaded_irq(dev, irq, NULL, xiic_process,
1487+
IRQF_ONESHOT, pdev->name, i2c);
14881488
if (ret)
14891489
return ret;
14901490

@@ -1527,21 +1527,21 @@ static int xiic_i2c_probe(struct platform_device *pdev)
15271527

15281528
static void xiic_i2c_remove(struct platform_device *pdev)
15291529
{
1530+
struct device *dev = &pdev->dev;
15301531
struct xiic_i2c *i2c = platform_get_drvdata(pdev);
15311532
int ret;
15321533

15331534
/* remove adapter & data */
15341535
i2c_del_adapter(&i2c->adap);
15351536

1536-
ret = pm_runtime_get_sync(i2c->dev);
1537-
1537+
ret = pm_runtime_get_sync(dev);
15381538
if (ret < 0)
1539-
dev_warn(&pdev->dev, "Failed to activate device for removal (%pe)\n",
1539+
dev_warn(dev, "Failed to activate device for removal (%pe)\n",
15401540
ERR_PTR(ret));
15411541
else
15421542
xiic_deinit(i2c);
15431543

1544-
pm_runtime_put_sync(i2c->dev);
1544+
pm_runtime_put_sync(dev);
15451545
}
15461546

15471547
static const struct dev_pm_ops xiic_dev_pm_ops = {

0 commit comments

Comments
 (0)