From patchwork Thu Oct 26 10:18:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13437455 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9867EC25B48 for ; Thu, 26 Oct 2023 10:19:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=u3ybI0OC6HDh9FH39Qvs48bySqz9I3MWnEmmvEcLSss=; b=MVxFmA7Hwlc46w yRlY3I67lV+/0r0dKGcqkRfdmwvMLFaH8/YBGJ/mqie5whgADORa+CDgVqzKRAy5LqcrH6X6ZCR7u Pl042gtNWe5kdsd7XNzKV6DvJpJxfA1WwsTY6HaTk6AhzPIiI+GQ7AG1/W1AwEyOH62Lh0HXJRtFZ o6y2RVrZROtZYH1Z/U84MkD3falxjeEJQbQfPMzNAb+dCm6/sAFlwRYoBPxDgGJIe0aNmPJUyyO58 4LfPjhDLnWc1JVLmVxXeZBrGhIb3nxeEun6RxukuJYNembxqGmJVQq1gdrEFdheCX5+F3Ett+7gck ELl6BQlF6t0zXMEp6aTg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qvxRt-00E9bK-03; Thu, 26 Oct 2023 10:18:45 +0000 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qvxRp-00E9Xi-0J for linux-amlogic@lists.infradead.org; Thu, 26 Oct 2023 10:18:42 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qvxRc-0002nf-A9; Thu, 26 Oct 2023 12:18:28 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qvxRb-004O1u-S9; Thu, 26 Oct 2023 12:18:27 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qvxRb-006XTy-IX; Thu, 26 Oct 2023 12:18:27 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sean Young , Mauro Carvalho Chehab , Neil Armstrong , Kevin Hilman Cc: Jerome Brunet , Martin Blumenstingl , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 1/3] media: meson-ir-tx: Convert to use devm_rc_register_device() Date: Thu, 26 Oct 2023 12:18:18 +0200 Message-ID: <20231026101816.2460464-6-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231026101816.2460464-5-u.kleine-koenig@pengutronix.de> References: <20231026101816.2460464-5-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1486; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=+gu7PsQ78lu/drAjNNP19vItgRnGPLGh6eKbIvernDA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlOjzq2KqF2O8O/rskyEMRysHku4n4pOk8KXFCf x5HpCgkY2+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTo86gAKCRCPgPtYfRL+ TvcRB/4rd+V6XNLjuRxwdcLJzw6xCKG9UDWs9T7/yj4zrqlxcGZDbpiAgoR0NshP2YXVzc28tcg nMkrVP+xy+gPgdzIkp6lG/BQOIVXNKyzIFuXbKyPbDZi+TTiii8eTN+sjhpGxDQoEpm4Wc0FvTG QwdiGSEsaqXli4ufKoD7r1kNtgm6qNO8dd7nsrLrMwEWfCsaO7eEzGRxU19H3NxCsszezhpgsjz WRNBDqFt5MJRyr90G/REyOgox+5Vq8df9PPfZGMA9HCJihiBk6d7yR7z8YOZXDwKvQyITPgyg6e n1+KIp6zEp+chcq+jd352FCoYHJ+OkkOX4kFAJxY2K46IXmL X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-amlogic@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231026_031841_132287_BBCEEF59 X-CRM114-Status: GOOD ( 13.32 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org With that the remove callback can go away and also setting driver data becomes superfluous. Signed-off-by: Uwe Kleine-König --- drivers/media/rc/meson-ir-tx.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/media/rc/meson-ir-tx.c b/drivers/media/rc/meson-ir-tx.c index 6355b79893fb..dab548dc6302 100644 --- a/drivers/media/rc/meson-ir-tx.c +++ b/drivers/media/rc/meson-ir-tx.c @@ -360,25 +360,16 @@ static int __init meson_irtx_probe(struct platform_device *pdev) rc->s_tx_carrier = meson_irtx_set_carrier; rc->s_tx_duty_cycle = meson_irtx_set_duty_cycle; - ret = rc_register_device(rc); + ret = devm_rc_register_device(dev, rc); if (ret < 0) { dev_err(dev, "rc_dev registration failed\n"); rc_free_device(rc); return ret; } - platform_set_drvdata(pdev, rc); - return 0; } -static void meson_irtx_remove(struct platform_device *pdev) -{ - struct rc_dev *rc = platform_get_drvdata(pdev); - - rc_unregister_device(rc); -} - static const struct of_device_id meson_irtx_dt_match[] = { { .compatible = "amlogic,meson-g12a-ir-tx", @@ -388,7 +379,6 @@ static const struct of_device_id meson_irtx_dt_match[] = { MODULE_DEVICE_TABLE(of, meson_irtx_dt_match); static struct platform_driver meson_irtx_pd = { - .remove_new = meson_irtx_remove, .driver = { .name = DRIVER_NAME, .of_match_table = meson_irtx_dt_match, From patchwork Thu Oct 26 10:18:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13437456 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B59CBC25B6F for ; Thu, 26 Oct 2023 10:19:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hIzj8uJFqzjRyGX+pL0PqFSceF6EgCoyPjcTOFS+674=; b=xVdnhmb6i7e4DA IwufhpTavEWE+R1y1Y/aXDRCJgpMvP90N8opRJLrMQ5sb7bafPla/Ar7BmdDBP4sBnQt7Vd/u0AmS 9fMhF0qMveCJmBGAXp3n8d9RTPyhRv/68Q6wXXgpuog/Knu3CxQtQkuHTsHW3PFV7WzeA/XS4f6+u yWQ/c5a2y1Bv2S+PqA5xkSux4Fj/mXBSQ9M76H9w8nbwbIWBGAava7AyRWaS0DC53hc+Q/SfzjNFf qcGFTQf+0z6SrRLlquehItINdpkwAaONX1uhP2TP25jRvwAkAuV/60qLlWCfGE5rfuoKugRO7XVBE A30K0F6DInp6WgA2MPYg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qvxRu-00E9bn-0p; Thu, 26 Oct 2023 10:18:46 +0000 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qvxRp-00E9XH-0U for linux-amlogic@lists.infradead.org; Thu, 26 Oct 2023 10:18:43 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qvxRc-0002ng-Gp; Thu, 26 Oct 2023 12:18:28 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qvxRc-004O1x-2n; Thu, 26 Oct 2023 12:18:28 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qvxRb-006XU2-Pq; Thu, 26 Oct 2023 12:18:27 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sean Young , Mauro Carvalho Chehab , Neil Armstrong , Kevin Hilman Cc: Jerome Brunet , Martin Blumenstingl , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 2/3] media: meson-ir-tx: Simplify and improve using dev_err_probe() Date: Thu, 26 Oct 2023 12:18:19 +0200 Message-ID: <20231026101816.2460464-7-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231026101816.2460464-5-u.kleine-koenig@pengutronix.de> References: <20231026101816.2460464-5-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1611; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=xP/HXyC7f9rnqXpYHkc5zFosg3Ou9P4+kgR9nBBBZqc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlOjzrZOzRNoBEbh0+ts8giNj+oBxAwnhW3Xlhs b/TvKU1hnCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTo86wAKCRCPgPtYfRL+ Tr9wB/0Xr5LPgszjKEwgg3Eitd3x3TtWYxK/WCYKYhW6e2BCGfscdXowyievh3k5RKQxJxuZqoD HKqlVrMTSBYs6QKHgylNpfAdBD7hFYnGU5l6B9DXZJRUApiG2YyttKZ+kt/2V2f6jZD4fydC90B j5ql1oX55cMx1aphJ5Y2ooJX+QBiyikdkpdOFgRDr1PXzesCDVeN7rUgCVxGOaCExmjgumkMZEo c1PxcUhnNQuCT48r8yskGSW1j0GoTa5YJ079kIX9Wam0id9euK/fTLL+8A9Caw19iZb2N9MTPX3 q3bBrkTVooI0rKlGuj/zK4fTDDeAclJvcQv0Dd5pklRb9rNi X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-amlogic@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231026_031841_208533_68E8525C X-CRM114-Status: GOOD ( 12.37 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org With dev_err_probe() the error paths can be implemented in a more condensed way with the added benefit that the error code is added to the error messages by name. Signed-off-by: Uwe Kleine-König --- drivers/media/rc/meson-ir-tx.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/media/rc/meson-ir-tx.c b/drivers/media/rc/meson-ir-tx.c index dab548dc6302..bd85361d561f 100644 --- a/drivers/media/rc/meson-ir-tx.c +++ b/drivers/media/rc/meson-ir-tx.c @@ -333,20 +333,17 @@ static int __init meson_irtx_probe(struct platform_device *pdev) spin_lock_init(&ir->lock); ret = meson_irtx_mod_clock_probe(ir, &clk_nr); - if (ret) { - dev_err(dev, "modulator clock setup failed\n"); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "modulator clock setup failed\n"); + meson_irtx_setup(ir, clk_nr); ret = devm_request_irq(dev, irq, meson_irtx_irqhandler, IRQF_TRIGGER_RISING, DRIVER_NAME, ir); - if (ret) { - dev_err(dev, "irq request failed\n"); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "irq request failed\n"); rc = rc_allocate_device(RC_DRIVER_IR_RAW_TX); if (!rc) @@ -362,9 +359,8 @@ static int __init meson_irtx_probe(struct platform_device *pdev) ret = devm_rc_register_device(dev, rc); if (ret < 0) { - dev_err(dev, "rc_dev registration failed\n"); rc_free_device(rc); - return ret; + return dev_err_probe(dev, ret, "rc_dev registration failed\n"); } return 0; From patchwork Thu Oct 26 10:18:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13437453 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6B7B1C25B6F for ; Thu, 26 Oct 2023 10:19:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=sDwMdGqngcrxl6vVah5u1K0Vu7gFhT2q1bqDaBUj6vc=; b=lxfMYqvamq0gy3 iK0fT8+l8ACYJjlOsVItuHqp+tjqBNx0JDGRpaflJU5Pe/IWCVhsD7adBSvjrgzmAA+iWFJMiGklX 1w+v8PGMP05Lqu1tenev3Q8w+bw5TKtpZ0oq6vb+dKQRgtOBYRy8YqgK+mRltdPEqEdIfXnUrQu2O lLiZfLOMgPzX4mbbD6nN5uvThlCUNGiJfqab2TXMgpNnRNzfqGStqGrl2cXJNnZQBjC5SCNf/9zeX EEUfeUIYfNH7TBI9kPU1j5qeT4fodwzTsiTnYMOnElTG6MTApQUwyEwY7/t9fBo+oDxDjVxo0nwGa JHM44ri8fU+CywDtB9NA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qvxRv-00E9cb-2M; Thu, 26 Oct 2023 10:18:47 +0000 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qvxRp-00E9XM-0X for linux-amlogic@lists.infradead.org; Thu, 26 Oct 2023 10:18:43 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qvxRc-0002oI-MQ; Thu, 26 Oct 2023 12:18:28 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qvxRc-004O20-8x; Thu, 26 Oct 2023 12:18:28 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qvxRb-006XU6-Vn; Thu, 26 Oct 2023 12:18:27 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sean Young , Mauro Carvalho Chehab , Neil Armstrong , Kevin Hilman Cc: Jerome Brunet , Martin Blumenstingl , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 3/3] media: meson-ir-tx: Drop usage of platform_driver_probe() Date: Thu, 26 Oct 2023 12:18:20 +0200 Message-ID: <20231026101816.2460464-8-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231026101816.2460464-5-u.kleine-koenig@pengutronix.de> References: <20231026101816.2460464-5-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1933; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=vc0rJ8a46VVSlA0HFx7Dn4WOCC0eWWSYg5tIiKkiq4M=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlOjzsCB78wx1ZkNeeTKhvksKu4eVjXNuc4O1qP eCAsxs+oACJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZTo87AAKCRCPgPtYfRL+ Tp58CACHg1uU+5cM/jq9rx7aO0xIbGNXGC/vIpXdtfz8Wx22dfmnQex6v/mAR3r+IGhX5qbP60E G1yZwI8RlMSg2UjLJydp7ct02Gmf6063fpykCZehxH+aMRrJXQ7KiqqA1A2Y4BiX25SCyTfMabA IyFaw8nXz5X7UNF/YXfxPNCIcyeVTtk2oxU+doQ7CPa0FT+/PMec5ZL7jMI2IduUlFqFNPfMAXt zWQVV5cAcrg0IIa4WZPKWedxr6zGp/9oA+VzwOj8FHRIA18VLx+GCY5GK/oKt8C84XRDT3akcHC YB7ZSWebXRVJ5X1o8dlZOvXygWBMNHLR3wd4Z72dfiVgk3+R X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-amlogic@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231026_031841_208292_BC22F49A X-CRM114-Status: GOOD ( 15.23 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org The benefit of platform_driver_probe() here is only that the probe function can be discarded after the driver is loaded. For an ARCH=arm allmodconfig that's 952 bytes, for an allnoconfig + IR_MESON_TX=y it's only 452 bytes. The downside is that the driver isn't dynamically bindable and unbindable. There are considerations to drop platform_driver_probe() as a concept that isn't relevant any more today. It comes with an added complexity that makes many users hold it wrong. (E.g. this driver didn't benefit as much as it could as of v6.6-rc1 as meson_irtx_remove() could have been marked with __exit.) The advantages are not that relevant any more today, so convert this driver to an ordinary platform driver. Signed-off-by: Uwe Kleine-König --- drivers/media/rc/meson-ir-tx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/rc/meson-ir-tx.c b/drivers/media/rc/meson-ir-tx.c index bd85361d561f..fded2c256f2a 100644 --- a/drivers/media/rc/meson-ir-tx.c +++ b/drivers/media/rc/meson-ir-tx.c @@ -305,7 +305,7 @@ static int meson_irtx_mod_clock_probe(struct meson_irtx *ir, return 0; } -static int __init meson_irtx_probe(struct platform_device *pdev) +static int meson_irtx_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct meson_irtx *ir; @@ -375,13 +375,13 @@ static const struct of_device_id meson_irtx_dt_match[] = { MODULE_DEVICE_TABLE(of, meson_irtx_dt_match); static struct platform_driver meson_irtx_pd = { + .probe = meson_irtx_probe, .driver = { .name = DRIVER_NAME, .of_match_table = meson_irtx_dt_match, }, }; - -module_platform_driver_probe(meson_irtx_pd, meson_irtx_probe); +module_platform_driver(meson_irtx_pd); MODULE_DESCRIPTION("Meson IR TX driver"); MODULE_AUTHOR("Viktor Prutyanov ");