Thread (6 messages) 6 messages, 2 authors, 2026-01-22

Re: [PATCH v2 1/2] i2c: xiic: switch to generic device property accessors

From: Andy Shevchenko <hidden>
Date: 2026-01-22 09:00:01
Also in: linux-i2c, lkml

On Thu, Jan 22, 2026 at 08:32:31AM +0000, Abdurrahman Hussain via B4 Relay wrote:
Use generic device property accessors.
...
-	i2c = devm_kzalloc(&pdev->dev, sizeof(*i2c), GFP_KERNEL);
+	i2c = devm_kzalloc(dev, sizeof(*i2c), GFP_KERNEL);
 	if (!i2c)
 		return -ENOMEM;
This type of changes should go in a separate patch after this one.

...
 	mutex_init(&i2c->lock);
Please, consider also switching this (in yet another separate patch) to
devm_mutex_init().

...
-	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 < 0) {
-		dev_err_probe(&pdev->dev, ret, "Cannot claim IRQ\n");
+		dev_err_probe(dev, ret, "Cannot claim IRQ\n");
 		goto err_pm_disable;
Before doing it, just kill the message, it is a dup since devm_request_*irq*()
already prints the similar one on the error cases.
 	}
...

So, this patch should be transformed to three
- removing a dup message
- converting to device propries
- utilising the temporary 'dev' variable elsewhere

-- 
With Best Regards,
Andy Shevchenko


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help