From patchwork Thu Jan 19 09:21:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ye.xingchen@zte.com.cn X-Patchwork-Id: 644435 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A6E0C004D4 for ; Thu, 19 Jan 2023 09:21:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229766AbjASJVh (ORCPT ); Thu, 19 Jan 2023 04:21:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229606AbjASJVh (ORCPT ); Thu, 19 Jan 2023 04:21:37 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2943367787; Thu, 19 Jan 2023 01:21:34 -0800 (PST) Received: from mse-fl1.zte.com.cn (unknown [10.5.228.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4NyHF86QKDz8R03x; Thu, 19 Jan 2023 17:21:32 +0800 (CST) Received: from xaxapp03.zte.com.cn ([10.88.97.17]) by mse-fl1.zte.com.cn with SMTP id 30J9LK7E098576; Thu, 19 Jan 2023 17:21:20 +0800 (+08) (envelope-from ye.xingchen@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid31; Thu, 19 Jan 2023 17:21:23 +0800 (CST) Date: Thu, 19 Jan 2023 17:21:23 +0800 (CST) X-Zmail-TransId: 2af963c90b933074addf X-Mailer: Zmail v1.0 Message-ID: <202301191721230148862@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , Subject: =?utf-8?q?=5BPATCH=5D_i2c=3A_versatile=3A_Use_devm=5Fplatform=5Fget?= =?utf-8?q?=5Fand=5Fioremap=5Fresource=28=29?= X-MAIL: mse-fl1.zte.com.cn 30J9LK7E098576 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.137.novalocal with ID 63C90B9C.001 by FangMail milter! X-FangMail-Envelope: 1674120092/4NyHF86QKDz8R03x/63C90B9C.001/10.5.228.132/[10.5.228.132]/mse-fl1.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 63C90B9C.001/4NyHF86QKDz8R03x Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org From: ye xingchen Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: ye xingchen Reviewed-by: Andi Shyti Reviewed-by: Linus Walleij --- drivers/i2c/busses/i2c-versatile.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-versatile.c b/drivers/i2c/busses/i2c-versatile.c index 1ab419f8fa52..219aa8dd4454 100644 --- a/drivers/i2c/busses/i2c-versatile.c +++ b/drivers/i2c/busses/i2c-versatile.c @@ -64,15 +64,13 @@ static const struct i2c_algo_bit_data i2c_versatile_algo = { static int i2c_versatile_probe(struct platform_device *dev) { struct i2c_versatile *i2c; - struct resource *r; int ret; i2c = devm_kzalloc(&dev->dev, sizeof(struct i2c_versatile), GFP_KERNEL); if (!i2c) return -ENOMEM; - r = platform_get_resource(dev, IORESOURCE_MEM, 0); - i2c->base = devm_ioremap_resource(&dev->dev, r); + i2c->base = devm_platform_get_and_ioremap_resource(dev, 0, NULL); if (IS_ERR(i2c->base)) return PTR_ERR(i2c->base);