From nobody Sat Sep 26 09:16:50 2026 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB12D4ACC70 for ; Wed, 2 Sep 2026 21:25:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788384309; cv=none; b=VTj9nICz8bjawOBuOY083fOxaSKPbHI8J2Lmdpak/GKN6T+oS8RW0ajb1wIqIowai4D2T1uqRIC/esaT1fBlstlh1A78kuQVAGm8yKDz5EhhYiTzY7U9jCHptgEkxH4KuIx/+l3ht3BfQn2sAwC73FRiGUH0VNTTZibmZfviRpU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788384309; c=relaxed/simple; bh=q9SAIJUr87M37a1nD9qzZab/gM5Ib5Ik8xsr+y/h9ic=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eihuQC//5cXM3XdYkvNY9N+pfNWff1BtIgaGaH51GsxMcSCHzuDgAovsYLqF4HRIKerj4Ov7au6gWQO2oZaJnj/8KW9/BMRpnnkyt4FSu5SoMkYwL5CrhD/S1BCz4BJdbD49aq8ww4BL2elKAiScow00ZbEZZiXVhc/nCg5KT/w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=XBcjtfLp; arc=none smtp.client-ip=209.85.210.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XBcjtfLp" Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-85339ed040aso1366741b3a.1 for ; Wed, 02 Sep 2026 14:25:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1788384301; x=1788989101; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=rGaS9rMCdfAhEqnXYmIjGA+bHQqtxuQ5ZcfYKFa0ZgI=; b=XBcjtfLpZxcpsZfEo/CtsE4o7q0y5V/edJMkwkaCEJdUvkEOQmOmObGeK2HEP0HMEH VTmfYr4frVZJZSjAuNBjPDT0aVSiFGaz5awYvLiEb4YPssgRddg1CasQlbodwF1cSYOS gBPAcjlHHPqNUqEZpeZL4ScV71LCYFrEVtRxWHiti6ooLeCozAMsX/mG1+/cWea9pfqx 3AwMG3AQ8HznZVOGR0fgDU6KqP7u4KTDlmGvEA5I8KWK8eezGcxbmffBoDvCHHBA7uEl Ywu6ZcVCHOyLaJSqKV8eUv95gUNzC5JI4cxA7SnD5SMLuj2XNRC3FZxoRdabo7W3VOfp U+/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788384301; x=1788989101; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=rGaS9rMCdfAhEqnXYmIjGA+bHQqtxuQ5ZcfYKFa0ZgI=; b=JpBCRME6+OgLq7rbuuHoLHgewF/6JcgtCC9S4JAvFlTsZH8mUmTUfDMDh0ZdKSonq0 yv/UqWssiy8jG+dKXVYv6qTSYVbTj/aE3wlZeNsfPKMOmYD+Xa8e/QJNGyZDU107AVP4 XGsRKKJDCCmZ4OIjPIMMpNdxCHAgvQIvg7CnDPVs6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05:6a00:1784:b0:857:7384:b5f7 with SMTP id d2e1a72fcca58-85ed4640c6dmr10398979b3a.19.1788384301297; Wed, 02 Sep 2026 14:25:01 -0700 (PDT) Received: from ryzen.lan ([2601:644:8000:7a86::e34]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cc43d40c55fsm90890a12.19.2026.09.02.14.24.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2026 14:25:00 -0700 (PDT) From: Rosen Penev To: linux-i2c@vger.kernel.org Cc: Andi Shyti , linux-kernel@vger.kernel.org (open list) Subject: [PATCHv2 1/3] i2c: ibm_iic: ioremap with platform pointer Date: Wed, 2 Sep 2026 14:24:54 -0700 Message-ID: <20260902212456.289608-2-rosenp@gmail.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260902212456.289608-1-rosenp@gmail.com> References: <20260902212456.289608-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use devm_platform_ioremap_resource() as it only needs a platform_device pointer. Call it early to avoid allocation of the main struct and to avoid having to use goto. Signed-off-by: Rosen Penev --- drivers/i2c/busses/i2c-ibm_iic.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_= iic.c index 7c70e8bda24e..20421ebe73ab 100644 --- a/drivers/i2c/busses/i2c-ibm_iic.c +++ b/drivers/i2c/busses/i2c-ibm_iic.c @@ -38,7 +38,6 @@ #include #include #include -#include #include #include =20 @@ -684,21 +683,21 @@ static int iic_probe(struct platform_device *ofdev) struct device_node *np =3D ofdev->dev.of_node; struct ibm_iic_private *dev; struct i2c_adapter *adap; + void __iomem *vaddr; const u32 *freq; int ret; =20 + vaddr =3D devm_platform_ioremap_resource(ofdev, 0); + if (IS_ERR(vaddr)) + return PTR_ERR(vaddr); + dev =3D kzalloc_obj(*dev); if (!dev) return -ENOMEM; =20 platform_set_drvdata(ofdev, dev); =20 - dev->vaddr =3D of_iomap(np, 0); - if (dev->vaddr =3D=3D NULL) { - dev_err(&ofdev->dev, "failed to iomap device\n"); - ret =3D -ENXIO; - goto error_cleanup; - } + dev->vaddr =3D vaddr; =20 init_waitqueue_head(&dev->wq); =20 @@ -751,9 +750,6 @@ static int iic_probe(struct platform_device *ofdev) free_irq(dev->irq, dev); } =20 - if (dev->vaddr) - iounmap(dev->vaddr); - kfree(dev); return ret; } @@ -772,7 +768,6 @@ static void iic_remove(struct platform_device *ofdev) free_irq(dev->irq, dev); } =20 - iounmap(dev->vaddr); kfree(dev); } =20 --=20 2.55.0 From nobody Sat Sep 26 09:16:50 2026 Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B5C54AE8A3 for ; Wed, 2 Sep 2026 21:25:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788384312; cv=none; b=f0yu9nkE8nGjgef48q73Nmo1qju2MIxYsc17Khd7TqQ4q4Xvx59+7W9fdfD733D4OXEQ5qdyJkIehvHF24xSnGTdrLQhGxksOxFMr4LUj+zdOfCT1PSdjPGl0iLsroim5PaKnxcIFOblSaaXg3rOryJ5PzjGu4TDb+JLImpNvVI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788384312; c=relaxed/simple; bh=LHhpRWV64svn2PO2cWWQEY87EXmjPNDpiKNVs+iud0M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bIL5IFoefAtmScfHuUzfhnyE5j64V5DGYHHX2HV93O0/9uxiVMS8oqQurPlyBdrCmRvNF/UYAUJ/KXcjRwPUNyEiMoLTB464ek6OhjVeiVTUC+ZuNhzb7NhlNFORz6no/uUN+ZY/Qo2Q45Dh2BSBXZq0Vag8uBpXsxOFu4KK5pc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=l+sA/duF; arc=none smtp.client-ip=209.85.210.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="l+sA/duF" Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-84f38f3b36eso1364670b3a.1 for ; Wed, 02 Sep 2026 14:25:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1788384303; x=1788989103; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=+/0STUVLZsyjAhQiRBiOnwe+jugMD4ztFWpPC89Ywfo=; b=l+sA/duF0T2zjwzPyElfx3MCquLfsCm0EzAlixgBgUDMzim60RT+4LCxp1Rfcjih2l A99b6dwyDMljOctKwGv9mZVApFXD6E1IxHMvALyFnbUU9NGJEx9cJ1ZkREkL04htSFxM 9yvL8enAD7uKi2zvGKE0Psvd7LcgIxcA3KWNkcRwkQkDzuIzi1mJNNFR0yGui/DMVvuL tDznS40ksF41Q6/9mdlJ7jZzCCWNC+MZIFCY2TV/FtCSxfhYx6bh396YbdEB4YVhpo1D 1oAJq90YUsfE99AhQX2IjGkl62sl4fH6zlLIQNOJIklHf3zNuTN4rlx5wzxuy+9scqrI 5Rqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788384303; x=1788989103; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=+/0STUVLZsyjAhQiRBiOnwe+jugMD4ztFWpPC89Ywfo=; b=qtCngnh7pmNntnuINMLoALyeytF0Psb8d1B4GK++huaoxDdvduV0LSqiPeguQrKHmU YxAej+UA6tfPCmkcib+avLvtwUFzqY0X8a1zQHzwYO7/8BjaBRpRdiUOPRJFjvUfLUDK csw3CDDuO1ZsxdBwCUNqrOuxoCfQENfBMbLIC5GWZ9eeiu7lw92gY6RJYP+SQ2QTuCW7 wZfSCtTWeqpqpI+yHfYnjik8/mq2SCuDOgExD/AnIxr8tzJuH+YtlTPTFSula9h3Kr9z 0nIlRdk1V0fRQecoTMBa6MqniQ8YPVMObVX+HDaiOCSkNVqX06Fqx2ML/iKjSp6JPYh2 UhWQ== X-Forwarded-Encrypted: i=1; AKwUvBzGKV5ZqIZkjm3FmDD+iJjCvnBNWBMOOEkqe53+ZyTerlYmX0hMtsQ3c67xYzKaUuy10ucyLiJkQqgtfw8=@vger.kernel.org X-Gm-Message-State: AFuF++nHsU7uJLvIicMzs+Q4pl1C6gCcHHJNAB0C1IhsuOGvU+BWUzhZ hGwreRg9er91BlQBQTpZF9MOHsAPSUn+aVk97zNEYc6vhFXZZUb62D97 X-Gm-Gg: AYBFou3gfElO7BfukKQ+LhPH4yXNAGG51efGygydXnS4tuUEOPYw5H88G/qeIXBee+0 AyByPgka7ba3sIR4Pe5kp5LQpS27AhirKn1SgsFD/lKNB8A8zTeKZjDWEyBSoQM0+dRyhCbY+s2 5p+BBrQLUYCQ5eOJIkxI7mMgFyAX7Hoci+XKi1rDt+2ae1K7dnH2yKzTYoKH4tt1FgHkdyZur+v nb6YnKsO+0oqQBzGFl+IzmpyMPLGpi5hMQKviTrrFFSw9s/8kh8bWxOKSYqo6L15ErzU3NEcrf8 +0BgcYZl7XiAxWy2KJ22FxUR7otGg0P2LSM15zbAUbmm7S3GgfOxAMfoaobm87VIwPX3PgmrN8j c5BBu1Hz4l+PGWMMUzcFJNLLRnwvoEXeHktsTJIGlxkyLLDZfF19Q07bse2fMDCb0rxDpoWDhKn lrRiq3Cd5/WX41I1GZ+4v+icS4kNlS169FYJqQfmkIWVxZJDJW3JeJVM9IQdz1O2RteEvquOJhG 2UULEiiI8b04+7WaqDs9xlsyoW7qIZy4xUwWjjg0mBLUkrE3JmCF9jEzo8H84bsMkg81mmRXfNh dAGZGDvSxAw/xOFcDXMXqzJCksSboTIEwOUZpw== X-Received: by 2002:a05:6a00:ad0b:b0:857:4dea:e1dd with SMTP id d2e1a72fcca58-85ed3c7d7b6mr11974426b3a.14.1788384302556; Wed, 02 Sep 2026 14:25:02 -0700 (PDT) Received: from ryzen.lan ([2601:644:8000:7a86::e34]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cc43d40c55fsm90890a12.19.2026.09.02.14.25.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2026 14:25:01 -0700 (PDT) From: Rosen Penev To: linux-i2c@vger.kernel.org Cc: Andi Shyti , linux-kernel@vger.kernel.org (open list) Subject: [PATCHv2 2/3] i2c: ibm_iic: get the irq early in probe Date: Wed, 2 Sep 2026 14:24:55 -0700 Message-ID: <20260902212456.289608-3-rosenp@gmail.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260902212456.289608-1-rosenp@gmail.com> References: <20260902212456.289608-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use platform_get_irq() which can return -EPROBE_DEFER, unlike irq_of_map_and_parse(). Check for iic_force_poll before doing so to avoid pointless work. Signed-off-by: Rosen Penev --- drivers/i2c/busses/i2c-ibm_iic.c | 43 ++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_= iic.c index 20421ebe73ab..8af666442952 100644 --- a/drivers/i2c/busses/i2c-ibm_iic.c +++ b/drivers/i2c/busses/i2c-ibm_iic.c @@ -648,31 +648,22 @@ static inline u8 iic_clckdiv(unsigned int opb) } =20 static int iic_request_irq(struct platform_device *ofdev, - struct ibm_iic_private *dev) + struct ibm_iic_private *dev) { - struct device_node *np =3D ofdev->dev.of_node; - int irq; - - if (iic_force_poll) - return 0; - - irq =3D irq_of_parse_and_map(np, 0); - if (!irq) { - dev_err(&ofdev->dev, "irq_of_parse_and_map failed\n"); - return 0; - } + int ret; =20 /* Disable interrupts until we finish initialization, assumes * level-sensitive IRQ setup... */ iic_interrupt_mode(dev, 0); - if (request_irq(irq, iic_handler, 0, "IBM IIC", dev)) { - dev_err(&ofdev->dev, "request_irq %d failed\n", irq); + ret =3D request_irq(dev->irq, iic_handler, 0, "IBM IIC", dev) + if (ret) { + dev_err(&ofdev->dev, "request_irq %d failed\n", dev->irq); /* Fallback to the polling mode */ - return 0; + return ret; } =20 - return irq; + return ret; } =20 /* @@ -685,12 +676,23 @@ static int iic_probe(struct platform_device *ofdev) struct i2c_adapter *adap; void __iomem *vaddr; const u32 *freq; + int irq; int ret; =20 vaddr =3D devm_platform_ioremap_resource(ofdev, 0); if (IS_ERR(vaddr)) return PTR_ERR(vaddr); =20 + if (iic_force_poll) { + irq =3D 0; + } else { + irq =3D platform_get_irq(ofdev, 0); + if (irq =3D=3D -EPROBE_DEFER) + return irq; + if (irq < 0) + dev_warn(&ofdev->dev, "using polling mode\n"); + } + dev =3D kzalloc_obj(*dev); if (!dev) return -ENOMEM; @@ -701,9 +703,12 @@ static int iic_probe(struct platform_device *ofdev) =20 init_waitqueue_head(&dev->wq); =20 - dev->irq =3D iic_request_irq(ofdev, dev); - if (!dev->irq) - dev_warn(&ofdev->dev, "using polling mode\n"); + dev->irq =3D irq; + if (dev->irq > 0) { + ret =3D iic_request_irq(ofdev, dev, irq); + if (ret) + dev->irq =3D 0; + } =20 /* Board specific settings */ if (iic_force_fast || of_get_property(np, "fast-mode", NULL)) --=20 2.55.0 From nobody Sat Sep 26 09:16:50 2026 Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A38DB19C54E for ; Wed, 2 Sep 2026 21:25:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788384312; cv=none; b=JnpWeIVw9WJqb6lD7DgUpg15oZRdVFgXHKPd8eo1WGzzJIH2Hw8sCuC4tazdTV+OLHecoWIvBtWtFDN52R4dgoJKVnI89fJPcsKh7dmDIR1oEFdKycPNU5FWjhAXL3L2Or7GRUNJVmt020VuqPkvzdgC6SxcHNFspjGy6R62y/8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788384312; c=relaxed/simple; bh=t7gejd7pyTIJ2I7S4voK9PUjbWOEyRbCiGgVq4K0UpI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b2cwyI3Buo2Q9NEHQ6sedA/LW+YdpJSQSe6dsjcKL+8+JIF8gPMPxMDtB6l5KHjSlpR1ZXf3tBu3yw7OYtOMkxJ3O2xb/ixvUa34+vZ2XzWpdeiuRIJtsy0LzkMmMuZ0V+4HfotpoEnBnqWEo9qZWZnBdp1LC6VHHLd0jd9X3gY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OWt99sef; arc=none smtp.client-ip=209.85.215.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OWt99sef" Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-cc1b838f9b6so1809093a12.3 for ; Wed, 02 Sep 2026 14:25:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1788384304; x=1788989104; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=v79KdHEjlvBLg7mwEWFWAGAPOJe9EFP/OK1uhnL10sw=; b=OWt99sefuErqJBN/8NdmxiZyZXwzf2B8MxeKNWLAk6q0LjFV7itcUKcS82kYsBNstq pbWk+PgWN3xMVh+5jz3g8vfL1nCxZoBBRL/1TX7KduFHVRKAidejWVVf/nFo7jq3KgKQ Zs6z/9HdFYIl6x4HOx6KNh5xR0l1ssmA/mSpKEMMbFr6TT8nCpDdZ6M8GuPa9nWnQaBd cqY8pPqK0WU4UUpXRrLKO96VzCSK1ofVcTiyQg77EmiuHVZ26nwMDieYCJfIIVGfEZ+1 JypPGm/LvslT1GjNR5wThW7kH0jYzNJNT4CYfW41zef0u+7a2C90MSGNn6D1wBLhjowp lCWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788384304; x=1788989104; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=v79KdHEjlvBLg7mwEWFWAGAPOJe9EFP/OK1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Yi4uFJb2FUwW44xz/SCqkxDtCi71exUMSc7wLYsAOr9VB/KSQse5C5druDX75wa wzBAZdKiYP1JCiAYTgxIlq/WKVQxoxUm9h2+JmSr3/OSd2MUxuscZ2qdGLjiFNvMcIxh001Z8U9 8faKOGBWod/CrvoZ+vcBUSr9Pw0Fa8kY+wA46A== X-Received: by 2002:a05:6a21:70c5:b0:3cc:ec12:a788 with SMTP id adf61e73a8af0-3d9acb3e96emr13064690637.4.1788384303970; Wed, 02 Sep 2026 14:25:03 -0700 (PDT) Received: from ryzen.lan ([2601:644:8000:7a86::e34]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cc43d40c55fsm90890a12.19.2026.09.02.14.25.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2026 14:25:03 -0700 (PDT) From: Rosen Penev To: linux-i2c@vger.kernel.org Cc: Andi Shyti , 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 Message-ID: <20260902212456.289608-4-rosenp@gmail.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260902212456.289608-1-rosenp@gmail.com> References: <20260902212456.289608-1-rosenp@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Get rid of kfree in failure and remove paths. Signed-off-by: Rosen Penev --- 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"); } =20 - dev =3D kzalloc_obj(*dev); + dev =3D devm_kzalloc(&ofdev->dev, sizeof(*dev), GFP_KERNEL); if (!dev) return -ENOMEM; =20 @@ -755,7 +755,6 @@ static int iic_probe(struct platform_device *ofdev) free_irq(dev->irq, dev); } =20 - kfree(dev); return ret; } =20 @@ -772,8 +771,6 @@ static void iic_remove(struct platform_device *ofdev) iic_interrupt_mode(dev, 0); free_irq(dev->irq, dev); } - - kfree(dev); } =20 static const struct of_device_id ibm_iic_match[] =3D { --=20 2.55.0