From: Rosen Penev <rosenp@gmail.com>
To: linux-i2c@vger.kernel.org
Cc: Andi Shyti <andi.shyti@kernel.org>,
linux-kernel@vger.kernel.org (open list)
Subject: [PATCHv2 3/3] i2c: ibm_iic: use devm for main allocation
Date: Wed, 2 Sep 2026 14:24:56 -0700 [thread overview]
Message-ID: <20260902212456.289608-4-rosenp@gmail.com> (raw)
In-Reply-To: <20260902212456.289608-1-rosenp@gmail.com>
Get rid of kfree in failure and remove paths.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/i2c/busses/i2c-ibm_iic.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c
index 8af666442952..d577bf47fa56 100644
--- a/drivers/i2c/busses/i2c-ibm_iic.c
+++ b/drivers/i2c/busses/i2c-ibm_iic.c
@@ -693,7 +693,7 @@ static int iic_probe(struct platform_device *ofdev)
dev_warn(&ofdev->dev, "using polling mode\n");
}
- dev = kzalloc_obj(*dev);
+ dev = devm_kzalloc(&ofdev->dev, sizeof(*dev), GFP_KERNEL);
if (!dev)
return -ENOMEM;
@@ -755,7 +755,6 @@ static int iic_probe(struct platform_device *ofdev)
free_irq(dev->irq, dev);
}
- kfree(dev);
return ret;
}
@@ -772,8 +771,6 @@ static void iic_remove(struct platform_device *ofdev)
iic_interrupt_mode(dev, 0);
free_irq(dev->irq, dev);
}
-
- kfree(dev);
}
static const struct of_device_id ibm_iic_match[] = {
--
2.55.0
prev parent reply other threads:[~2026-09-02 21:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 21:24 [PATCHv2 0/3] use devm and get irq in probe Rosen Penev
2026-09-02 21:24 ` [PATCHv2 1/3] i2c: ibm_iic: ioremap with platform pointer Rosen Penev
2026-09-02 21:24 ` [PATCHv2 2/3] i2c: ibm_iic: get the irq early in probe Rosen Penev
2026-09-02 21:24 ` Rosen Penev [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260902212456.289608-4-rosenp@gmail.com \
--to=rosenp@gmail.com \
--cc=andi.shyti@kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®