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
This commit is contained in:
Abdurrahman Hussain 2026-02-23 15:59:19 +00:00 committed by Andi Shyti
parent b621a966fb
commit b698377976
No known key found for this signature in database
GPG Key ID: DA78056626D32D6E

View File

@ -1430,7 +1430,7 @@ static int xiic_i2c_probe(struct platform_device *pdev)
u8 i;
u32 sr;
i2c = devm_kzalloc(&pdev->dev, sizeof(*i2c), GFP_KERNEL);
i2c = devm_kzalloc(dev, sizeof(*i2c), GFP_KERNEL);
if (!i2c)
return -ENOMEM;
@ -1446,7 +1446,7 @@ static int xiic_i2c_probe(struct platform_device *pdev)
if (irq < 0)
return irq;
pdata = dev_get_platdata(&pdev->dev);
pdata = dev_get_platdata(dev);
/* hook up driver to tree */
platform_set_drvdata(pdev, i2c);
@ -1468,9 +1468,10 @@ static int xiic_i2c_probe(struct platform_device *pdev)
return dev_err_probe(&pdev->dev, PTR_ERR(i2c->clk),
"failed to enable input clock.\n");
i2c->dev = &pdev->dev;
pm_runtime_set_autosuspend_delay(i2c->dev, XIIC_PM_TIMEOUT);
pm_runtime_use_autosuspend(i2c->dev);
i2c->dev = dev;
pm_runtime_set_autosuspend_delay(dev, XIIC_PM_TIMEOUT);
pm_runtime_use_autosuspend(dev);
ret = devm_pm_runtime_set_active_enabled(dev);
if (ret)
return ret;
@ -1482,9 +1483,8 @@ static int xiic_i2c_probe(struct platform_device *pdev)
if (ret || i2c->i2c_clk > I2C_MAX_FAST_MODE_PLUS_FREQ)
i2c->i2c_clk = 0;
ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
xiic_process, IRQF_ONESHOT,
pdev->name, i2c);
ret = devm_request_threaded_irq(dev, irq, NULL, xiic_process,
IRQF_ONESHOT, pdev->name, i2c);
if (ret)
return ret;
@ -1527,21 +1527,21 @@ static int xiic_i2c_probe(struct platform_device *pdev)
static void xiic_i2c_remove(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct xiic_i2c *i2c = platform_get_drvdata(pdev);
int ret;
/* remove adapter & data */
i2c_del_adapter(&i2c->adap);
ret = pm_runtime_get_sync(i2c->dev);
ret = pm_runtime_get_sync(dev);
if (ret < 0)
dev_warn(&pdev->dev, "Failed to activate device for removal (%pe)\n",
dev_warn(dev, "Failed to activate device for removal (%pe)\n",
ERR_PTR(ret));
else
xiic_deinit(i2c);
pm_runtime_put_sync(i2c->dev);
pm_runtime_put_sync(dev);
}
static const struct dev_pm_ops xiic_dev_pm_ops = {