From patchwork Mon Feb 5 13:55:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Elfring X-Patchwork-Id: 13545591 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 E5A47C48298 for ; Mon, 5 Feb 2024 13:55:58 +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:Subject:From:Cc:To:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=5oUCInfc2RwpYOEkN1Y7dOpSSKbhoTPNmjXQmC60090=; b=uAQsu6yqDrsI7Q QhTTK/qWFOYxp242jKiFrV3VbVCpkYTiHT1METgW5oghZGQtgpsGlfFj7PHAIo5nzquzDVF2bd/Uc 6bOAeovfdwh204XDKwTU8+RtfZnNjVXdgrrbFO1+HaKUumXkLPLhE+LKJb4vDm/pyyAEThJ1OkXFb S38LvMN01vuAntf825IsYoUxi4Bce0jO+0sa1IgokoTLtTV5VpV3MdZds5QIsdZ3oZKXWGSQQcVPZ f+0wCQlr2+XtQ/HgTqm2XnWPLj4nzGuQiKlDjZP0412AbKMbpb5/gW6icDpnwEmToL5WAgtlOzCrE Y0c00VK8GI5virWLdOhg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rWzRq-00000003Ukv-45RQ; Mon, 05 Feb 2024 13:55:46 +0000 Received: from mout.web.de ([212.227.15.3]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rWzRo-00000003UiW-0DDA for linux-arm-kernel@lists.infradead.org; Mon, 05 Feb 2024 13:55:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1707141327; x=1707746127; i=markus.elfring@web.de; bh=OCQlC6fsw7RMniTUmuvaoqgcVSnBwtdH0tkNLVCdCq8=; h=X-UI-Sender-Class:Date:To:Cc:From:Subject; b=HjTm0cjIhCbiMgsdEel77y7fv7NC6Nxsj7jv8GhO97SXEgb80r7lEmSsnvClOo2k VRo9narPy0zxhHgqewR5nWaWe1/RFPO8uhNXot/GYfNXg4/mfx9qGOE7ipoctl/QT 7ouWHRyhDooc+FoR8S4frgEy+udQ/exFyhlmIvp4OhY7oI+cjSyUBEFxCxYvaQieB LhkMTbxEPKAPTQTLXlPgAUB5eulc/PTD6LCMHpE5o70wlqNsuYvazVxq+KOFlXygY cfCED3D1wd7mfkxSWusHEb0HtYz+uWXaizN6O6dBrhoL4x85vo3Y+nEkCkawfPi9J 0yKqqnj6ySiWnpd2fg== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.85.95]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MBS71-1rjsY53cFD-00CvRd; Mon, 05 Feb 2024 14:55:26 +0100 Message-ID: Date: Mon, 5 Feb 2024 14:55:23 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-arm-kernel@lists.infradead.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Michal Simek , Paolo Abeni , Radhey Shyam Pandey , Rob Herring , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Wei Fang Content-Language: en-GB Cc: LKML From: Markus Elfring Subject: [PATCH] net: emaclite: Use devm_platform_get_and_ioremap_resource() in xemaclite_of_probe() X-Provags-ID: V03:K1:HpdtEuakUvahbDKCQGbUBcJH36NhioRvkShEPpZoWqMQzGg2Udd /66drifHYG+/g/EHez/UbXsmBO6j0hVXMihQB7PpnVN3Kse2RaGRq1n1IJLo83c6UWHPt5s qikcEeE6Nn8vGJ6t1+LCL6V9QE0S+Zo0yGsJ8wCOWwtjU5U5+7xpxcjAUs2W2cQ7M0/MfYj x/Ow/w0rihGGsmWWtwGjA== UI-OutboundReport: notjunk:1;M01:P0:DX5qSgtT2yY=;FgO4dz25//lf7S/k9N4m/F1fSkO +78p+4kNPIMGJRtNflgVgoo8qWGIRjTl7v4YzqPB0omKxGZYcRQHS4noibbgO910/zBmyQ6gc 2mRH8lIwjH5IniM5IZf3sV2O/z4nGGmc0GoJyZlXe/gCjTs+9+aA/f1RhSlXkcobxzD5HWRyQ pJbNLEYl8APxI7gnybKG85B7hepN1/dXB4enZK9uRd0DpJaY4qLZeR7Ob2MLGv4qwBR4zotGK aDtz5wbpYvPWsmgfDoKcP4og+HBncBXPmw+zbsyWTIp2uWUZwUhJcetr6I18EfgT0pHscP9+I MYgXJ/RFbIVd5PUtzwEAHQ4W9hyCH6BUHC3lQjhwI6mFwpSNldW4PEZTCyDQySY+WYIJhmTsE 74KAAOXWXE+pW3aIy+TCbj9yiazBfFnxMf0hGhoxhpOzQXRx/RMD38+YMgKpdJRHMWcvWv2nT e7hjhAqw+QFlZgKLBpMl4PSddZcJdh+MQXTDuRt+Aqde2pMDtv84pJjDUH9n6bkJ8YMsQBS0S 7LJa0LXIPbVChJ1NiaWXZGHw+YjaT08Ok840dYMU0oKOhcKud4fes9nw8OeF/4ypEYQDFYIaF v/nSLHcxZ4G9Xi86aUJJKztZ0KdsmRmkkww+4C5Ii0yn6PLacy5Hlfz9jB7knZN0GnjZSYhS9 wf1sAJc1rlqg74WElTVpPg0hj6l9HfZblAFKXiDPYmemE7EG1oNTq+LI8JVeuutSZGCKkZSvm KV/+6fWej+r7PuND9xJSZZBJx2rHyaL+wgT+zGftwKBCACI0cSx74W8ryUsdwGrfUdibxRzlR ZbImIoeCr/Io+lMei6EJiEb/cjz8qOscxadJIpCqJ3DiA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240205_055544_433778_3533C41D X-CRM114-Status: UNSURE ( 7.90 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Markus Elfring Date: Mon, 5 Feb 2024 14:44:20 +0100 A wrapper function is available since the commit 890cc39a879906b63912482dfc41944579df2dc6 ("drivers: provide devm_platform_get_and_ioremap_resource()"). Thus reuse existing functionality instead of keeping duplicate source code. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/net/ethernet/xilinx/xilinx_emaclite.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.43.0 diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c index 765aa516aada..940452d0a4d2 100644 --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c @@ -1114,8 +1114,7 @@ static int xemaclite_of_probe(struct platform_device *ofdev) ndev->irq = rc; - res = platform_get_resource(ofdev, IORESOURCE_MEM, 0); - lp->base_addr = devm_ioremap_resource(&ofdev->dev, res); + lp->base_addr = devm_platform_get_and_ioremap_resource(ofdev, 0, &res); if (IS_ERR(lp->base_addr)) { rc = PTR_ERR(lp->base_addr); goto error;