Message ID | 20230705135159.33327-8-frank.li@vivo.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp1890776vqx; Wed, 5 Jul 2023 07:03:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7PRWu4+XFnbtbagGdAxADHYC3E3TGJdjCFhVAW0tMcBIr+Cj4UXiSdPKTFs1zr5zReik6V X-Received: by 2002:a5d:9c91:0:b0:783:40ef:c9f6 with SMTP id p17-20020a5d9c91000000b0078340efc9f6mr15782072iop.19.1688565793070; Wed, 05 Jul 2023 07:03:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688565793; cv=pass; d=google.com; s=arc-20160816; b=tT8qrB2teNNB0hxRlNynHCssYSLNuKwJu1zCodEjYeWUroPpyJF2Xien+VtKrNRMRy xFaDgqee7o8+pjbQjZWJ7ukz2QB6KJ1uT6jFEHw+jLGgzOMnCoTWMUdz0G5iEa8xdRms BqvdMxe1BeTUdTKkYAfi/Q8pEJ0TXvAlVoz+FDsdqzpV2pUtZF/w9svKzDkIF97odmAE ZCjl8j2XprwTaMQKkIi4aBtkq7CD6LDk85gz7WS0LjHEYUvs4u42ADMvvVRIYzhc/sCA tdjJfB+Y52QdRy5VG9/KAkGJ0m7XgqH06BeCybObDblAtf4nPE5Dmz5YU3Uk9KwTVKOZ Q0Ug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XNgMkAVszr2VHTFJZOTnggT/8att7Um9d/tkp8iyTeo=; fh=EkbnMzRGrQxlaA39ySIhvjWIHCzfvOrkgC7GfrqJQoE=; b=FreuH3aDA50+WwWJJNxHucYkvB1yW5pWt9/k3JOY+VDbsMH9QaAUbgJIcsTGWyiMe8 HY0m6DzOwq+qGvke2sMqgkdeGi9z8JfpgLQHsQJGeVZXUlNguFMawPH2yq1yzDm+GmG5 zrJWzxf6+RYSYfahm0J4YkZa3xqtpU82chGmXjhGY88bM9sJ86OdAk2djMEigZH4q1YW Maq7bPBjje6lf+mU8BYx/++RKWbrkGN9fWULtvUDuhiSK7swVMeDrsELYOD9JiynieFv o3wOwmmq1e/JTQEqQHkpeb+AOz9DgwV48CTwXnnG7af5WDWX6aKcsBFLE5EeDt8BI/1b AcTg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=cIMruj38; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h71-20020a63834a000000b0055b89e75afdsi8828336pge.285.2023.07.05.07.02.55; Wed, 05 Jul 2023 07:03:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=cIMruj38; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232426AbjGENwg (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Wed, 5 Jul 2023 09:52:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232416AbjGENwa (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 5 Jul 2023 09:52:30 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2122.outbound.protection.outlook.com [40.107.117.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C36C173E; Wed, 5 Jul 2023 06:52:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MZkNCGy8auo+XFQTi1vDXWmTzYMesK1Va+0fEdq+2Pnb+CblCqJhMZhfQcKGdofnL37NGQDAi3PNOnZs5Qmxgi3CZcTpfydscNdnHNFhlVLqL7ui8bu69TwogzDXffsUCmsXd7XIBD6edd/5XA682j+OHM/qEjfuqyrXJWpJdnzFDT2peQjRCoIL+kVCT3arTmRrio04LhiEfBg8OA/2pzD+NlNvugh5W/uMR1uyN+HrctYbYZssoitVENUft/C7wLKhqAWOHraSNEs36HQVA2B1AcZ4vsGN2Pw5EDs0XLtS2kKkvtWtbIG1qK4AUoH88sqLe2hE22ILKLtNUR7SlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XNgMkAVszr2VHTFJZOTnggT/8att7Um9d/tkp8iyTeo=; b=QA+rnXJOPXWQLU7Yx16Zinxgj0iYrsSXazyYlbm2xPrFdkR9W9OcypnE6Gjd1Q2PFh3CY5gTgMW0pmTyTsMXT5JEMGY21SoQRVLYUP9Ngfq5zQbQWZlTxPIbAgLiQXbZUEjA8ItkM1YhhJhuhrDyFnTpEE2tTcBQVXpKZGgPNVwEpRVg1cRldD1wDoMUNakzH15Yfegph+3V3jH1rcy2ojyssupULZeiuYdAmd8zjfSq3DPha1phsu2lrHNDTE3dkYAi6xmGiRrbccC8IV0Wnd0TAdZ3Rra8hcbBRyMIyCCsRs3YNSvdES/cS4zz2lkQx08E8b9ZDuFBZQEAbQUgNQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XNgMkAVszr2VHTFJZOTnggT/8att7Um9d/tkp8iyTeo=; b=cIMruj38BB6eBY34hlpsYtTT8LIzWO24QE3uDiYHm976uwOEZP22FRwEWEGnOjBFXjQnhZCclPcs53yhwGN/Q9XqeydNUYxU8Uc8i2LwFFGxifDjm7upOiDM+j3E4f76ZvjlnlQr3g8XCXCBG59xNqkY0QbTUNDLz3cFiBRjYgmkB03c/adgbmFZEXB2+ZhfXOJ8gnZQAwVYfLKqYfd/7oqakHPjizJt4nWb/doV7gts6ojg5skdQldEZ445lzjzTjDJ3+nopwJWd0Ct3kCRaAF6Jbjzcz2Uv4xcq/r3VvoDxPa9cFC3bKoSDSBwPYQ94pZuhawYWDa7WlhxxnmkAA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by PSAPR06MB3991.apcprd06.prod.outlook.com (2603:1096:301:38::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul 2023 13:52:17 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c%5]) with mapi id 15.20.6565.016; Wed, 5 Jul 2023 13:52:17 +0000 From: Yangtao Li <frank.li@vivo.com> To: Wolfram Sang <wsa+renesas@sang-engineering.com>, Andi Shyti <andi.shyti@kernel.org> Cc: Yangtao Li <frank.li@vivo.com>, linux-renesas-soc@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/11] i2c: sh_mobile: Use devm_platform_get_and_ioremap_resource() Date: Wed, 5 Jul 2023 21:51:55 +0800 Message-Id: <20230705135159.33327-8-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230705135159.33327-1-frank.li@vivo.com> References: <20230705135159.33327-1-frank.li@vivo.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: TYCPR01CA0049.jpnprd01.prod.outlook.com (2603:1096:405:2::13) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|PSAPR06MB3991:EE_ X-MS-Office365-Filtering-Correlation-Id: be1328c1-184e-4c7a-37e7-08db7d5f0bb4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PCc69yQLv+FLOF8jIvsf/VTQi4V/ChXgZi/mbETUQ9qlF2MyUrWceScBLm0xBzrsUYEaRtHA28CbiPNEAoguDVUl3uDzuPWKpeWbPDqF+9VkyCfTqS4+TSJgCGxr4/mTQAZ/Zd5CQO72JpNyrGBepvNPd5vmNytfOLbw96k+yhmZoiHC0Rwsae2oAJAjs/Dc1eDYtHs98Tkef0I2Lmx4jpX5BHHJGkXCHWmEoKBpatki7p3Brql8X6cMZ/bnTZZBMmijwvppx4BiguR/jwSZWVQxU2A8OFGxARVXZTkAlfK/i6MsQJXMSrwfQFnZDwVWtqHkAkqXcFm0jNqmtliRpMyb3rBLfBclNVbrT4nIejbDqXO3UVWdlZVjwqglqgGF7+QQDKovowATjo7dsQP8we+hK62o1gYORlILQZC+43/TZS3pfqeyW81vTXzrsCyOX5dHT0eSwhF0CwNd6yEWRqbV8I/9l66z0749EPYIL7PeY8rsphE3JrKW0QA0yEBamTWGmPOElX19t3Dfc31Dj5fsw0Jg5/ES8fMzCfNBGdWs0AyfyXUaeP2iheKpT955tkTH+p6b/UJW45VoGYenoSvUe/KSpyvAIHsStTNlDN3kxpVmTYp/q7o6Eeyakc/X X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(346002)(136003)(376002)(39860400002)(451199021)(38100700002)(38350700002)(66476007)(66556008)(4326008)(66946007)(2616005)(186003)(86362001)(6486002)(52116002)(6666004)(36756003)(6512007)(26005)(6506007)(478600001)(110136005)(1076003)(8936002)(8676002)(5660300002)(316002)(2906002)(41300700001)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dOWUuJPgM+wgI0NN2TY5j2awfYqRU9oXBA0rO6XrO+/6usjdVywT6kD5NGNGPaRuBr8WLdgWZpMpp99YC4pkCRDP9cYPnerT2F1iz1mi/pb+UyT6cT4vFM83N6wZ9w5u/bfmFjI5R8tM8EfhD1cXfyR4Qs0A9ZATN+y12zmPGqXV5OApZkizei8iBYybds7TaqiNvnMf5MxUEp6zvZ90ayesW+0tAkyIe1uy1SYLhi3K9zCMuBgna93XXx/rO7m5dX7z3SijvPV3eZ9fNVN//7RI9gdC2TG4EDMzEdBQ6bF4pszcI6UaHiHG7rQUjWIqrZ9k6z7pgUISNwspF7861I5JRcaylhPQ6ygaBFWosoyKKOV/vIU7SArbFL158JMiWdccfM+yBQyc/0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evsARv/eLHmz+NjgBCY+00VrWJtdNY89LCtF7Fy7WSC3aTLfQHvG5Pc2z2STN3R5X1pG4cflQ+Rt4KoFQcrWGf5FkDw7W0hf6xfXItRhQrzzkaoYy4nj/HQ6Drv X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: be1328c1-184e-4c7a-37e7-08db7d5f0bb4 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 13:52:17.6430 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: WGNNT2djHy/oA9CrpIMwuwCYKxfM0a66pM0UQ8jzmgOq533KYJZSlO7fbI9mPUcc1lNf6KYtlKEHsVw/HaMQHw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PSAPR06MB3991 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770589564868193077?= X-GMAIL-MSGID: =?utf-8?q?1770589564868193077?= |
Series |
[01/11] i2c: at91: Use devm_platform_get_and_ioremap_resource()
|
|
Commit Message
李扬韬
July 5, 2023, 1:51 p.m. UTC
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: Yangtao Li <frank.li@vivo.com>
---
drivers/i2c/busses/i2c-sh_mobile.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
Comments
Hi Yangtao, On Wed, Jul 5, 2023 at 3:56 PM Yangtao Li <frank.li@vivo.com> wrote: > 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: Yangtao Li <frank.li@vivo.com> Thanks for your patch! > --- a/drivers/i2c/busses/i2c-sh_mobile.c > +++ b/drivers/i2c/busses/i2c-sh_mobile.c > @@ -893,12 +893,10 @@ static int sh_mobile_i2c_probe(struct platform_device *dev) > pd->dev = &dev->dev; > platform_set_drvdata(dev, pd); > > - res = platform_get_resource(dev, IORESOURCE_MEM, 0); > - > - pd->res = res; > - pd->reg = devm_ioremap_resource(&dev->dev, res); > + pd->reg = devm_platform_get_and_ioremap_resource(pdev, 0, &res); "pdev" does not exist in this context. Please try to at least compile-test your patches before submitting them. > if (IS_ERR(pd->reg)) > return PTR_ERR(pd->reg); > + pd->res = res; While at it, you could get rid of "res", and replace it by "pd->res" in the above call to devm_platform_get_and_ioremap_resource(). > > ret = of_property_read_u32(dev->dev.of_node, "clock-frequency", &bus_speed); > pd->bus_speed = (ret || !bus_speed) ? I2C_MAX_STANDARD_MODE_FREQ : bus_speed; Gr{oetje,eeting}s, Geert
> Please try to at least compile-test your patches before submitting them.
Yes and no. Not "please try" but "please do". Rejecting this series
until it has been build tested.
diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c index 21717b943a9e..e2da633b5e9d 100644 --- a/drivers/i2c/busses/i2c-sh_mobile.c +++ b/drivers/i2c/busses/i2c-sh_mobile.c @@ -893,12 +893,10 @@ static int sh_mobile_i2c_probe(struct platform_device *dev) pd->dev = &dev->dev; platform_set_drvdata(dev, pd); - res = platform_get_resource(dev, IORESOURCE_MEM, 0); - - pd->res = res; - pd->reg = devm_ioremap_resource(&dev->dev, res); + pd->reg = devm_platform_get_and_ioremap_resource(pdev, 0, &res); if (IS_ERR(pd->reg)) return PTR_ERR(pd->reg); + pd->res = res; ret = of_property_read_u32(dev->dev.of_node, "clock-frequency", &bus_speed); pd->bus_speed = (ret || !bus_speed) ? I2C_MAX_STANDARD_MODE_FREQ : bus_speed;