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

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Abdurrahman Hussain and committed by
Andi Shyti
b6983779 b621a966

+12 -12
+12 -12
drivers/i2c/busses/i2c-xiic.c
··· 1430 1430 u8 i; 1431 1431 u32 sr; 1432 1432 1433 - i2c = devm_kzalloc(&pdev->dev, sizeof(*i2c), GFP_KERNEL); 1433 + i2c = devm_kzalloc(dev, sizeof(*i2c), GFP_KERNEL); 1434 1434 if (!i2c) 1435 1435 return -ENOMEM; 1436 1436 ··· 1446 1446 if (irq < 0) 1447 1447 return irq; 1448 1448 1449 - pdata = dev_get_platdata(&pdev->dev); 1449 + pdata = dev_get_platdata(dev); 1450 1450 1451 1451 /* hook up driver to tree */ 1452 1452 platform_set_drvdata(pdev, i2c); ··· 1468 1468 return dev_err_probe(&pdev->dev, PTR_ERR(i2c->clk), 1469 1469 "failed to enable input clock.\n"); 1470 1470 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); 1474 1475 ret = devm_pm_runtime_set_active_enabled(dev); 1475 1476 if (ret) 1476 1477 return ret; ··· 1483 1482 if (ret || i2c->i2c_clk > I2C_MAX_FAST_MODE_PLUS_FREQ) 1484 1483 i2c->i2c_clk = 0; 1485 1484 1486 - ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, 1487 - xiic_process, IRQF_ONESHOT, 1488 - pdev->name, i2c); 1485 + ret = devm_request_threaded_irq(dev, irq, NULL, xiic_process, 1486 + IRQF_ONESHOT, pdev->name, i2c); 1489 1487 if (ret) 1490 1488 return ret; 1491 1489 ··· 1527 1527 1528 1528 static void xiic_i2c_remove(struct platform_device *pdev) 1529 1529 { 1530 + struct device *dev = &pdev->dev; 1530 1531 struct xiic_i2c *i2c = platform_get_drvdata(pdev); 1531 1532 int ret; 1532 1533 1533 1534 /* remove adapter & data */ 1534 1535 i2c_del_adapter(&i2c->adap); 1535 1536 1536 - ret = pm_runtime_get_sync(i2c->dev); 1537 - 1537 + ret = pm_runtime_get_sync(dev); 1538 1538 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", 1540 1540 ERR_PTR(ret)); 1541 1541 else 1542 1542 xiic_deinit(i2c); 1543 1543 1544 - pm_runtime_put_sync(i2c->dev); 1544 + pm_runtime_put_sync(dev); 1545 1545 } 1546 1546 1547 1547 static const struct dev_pm_ops xiic_dev_pm_ops = {