Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp34939802rwd; Sun, 9 Jul 2023 23:40:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlGGkjiWc6aUVPgdrIvg0NyKsLFwcpTu4+1/SJDWhZaRvk5DSvQAKGSMxMBDGStMNDVb2RLf X-Received: by 2002:aa7:db48:0:b0:51d:b0a4:1d44 with SMTP id n8-20020aa7db48000000b0051db0a41d44mr8406576edt.29.1688971223846; Sun, 09 Jul 2023 23:40:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688971223; cv=pass; d=google.com; s=arc-20160816; b=tIOda738B9AUV6KlHZSph0vTujjcC67WoVoAFJ1hjZbxnQF99JvKWKJgDFegc2UGE+ x1k+xJ6g60NcNeBwfM7YvewoU2Ag+1jUENLHfTy5PVXcXVXGh0WDXnDUzUMC1bhfzaC2 TQldyaYyxf9HtIOaxDbNx+G66X5mL6XzgWO+BGxo9he540jQPYpjEY33RdpQSICo4lX6 ohgRVQmnlbPJ0TDJyNnSzNKdJLyQQ4epwEtyntoqM0KazKP/L2XcLq6fyJssbmMHmPyX 88kNjlFgXeRcGnzJ1PLBK05jxSIZAz6/VAmdld2azkHBwpru+88XViuHYG4abqC/3EGM mRCw== 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=o+wD2OlQ9bWbKD7HJUG1jwJAxm3onlW79BpaaRcJxpY=; fh=IsijGJlTf7l1DAwcQtQcojm05Wx67hMZ0pbuQcIRp/w=; b=qfCnSlHrBGblFgnv3ERnpdEIUvWIdSdRfW6LK3snk8GP6MoHf7rFxgkAFImioelr7q MWQlhrWQ0u19G6lP8Cg1KKYNCSF+PyF+mvcrpBZdkmq/W5Z/2AZi0jBaQEACLyUjYpkx P+Q9D744HkXFLG5ojSXRL2rcDBAGlC3a8qVAVTvRirLWXJNuSNsqCuf+NyvYbwjyHeQ+ fwhYdweiSQ1Bo7ume/3pgxt9J+w0NZfDzzMcCeYVqce5kGJAGT6TIFIWhs19ggWwb5KY CXoUAXOpCwAHvDH8GrsLBtJuUCnENEItuiOA6mbPVfur6s6QfEnrQRtqYCer2Ve4z2uE 8Ibg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=Vx2DBHst; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e25-20020a056402089900b0051a324db9bcsi5411589edy.304.2023.07.09.23.40.00; Sun, 09 Jul 2023 23:40:23 -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=Vx2DBHst; 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 S231494AbjGJGeh (ORCPT + 99 others); Mon, 10 Jul 2023 02:34:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231292AbjGJGeT (ORCPT ); Mon, 10 Jul 2023 02:34:19 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2112.outbound.protection.outlook.com [40.107.215.112]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D01231AB; Sun, 9 Jul 2023 23:34:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YVCwCDLFbYy/UnHtcFFkp8Rj7Fo02/YrV3b0dYzXPFWG7whq+XC4/D9OOA1///ehpYNq0E9URwYiiiXjKBv21uVBIV2PUqtWPzlO3ROvFBU/0f6/fJJ4Nrg+pLYHQVFaF3ATrmBbtAwwYDHVucIrsvUmLvhl7q62s9eELcDySzTL/j6Suu7tcWOAAf9ihtvpUx4HyE09HMnn3lgakxYuw8flzfieXKnclq6iezKJXVsioTor73+PKFmWg8sm0uNarT4WGGMRCqEaemDBPPAjvQeoHItn0KJbD/B/WWAikP1eiDiaoZdOctQhnsaeQif4DRO2f39UCRk7Jmx/5IcZ7A== 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=o+wD2OlQ9bWbKD7HJUG1jwJAxm3onlW79BpaaRcJxpY=; b=AczP2kkzwGpMoelA6CayRZDGkD1SleecE7aaJnhDmcBidtCq/GJsVR2XOUV5u+Ewwwp1AOmpSNtQwC33PTG0CFeLuVjSH6IYLj4ZG7rOsJ81Hg5VAfnWOZkRp37MCfxajOYhdjiXNG1BtPZaI88U8/1ff9S8l9Htt8+QYSMtYziFEjW+UgKEybryv+6nNpwkg5+q0nW8snPSRTO7mesW/vbomPFp/Pmm/q6W281NPL24IrqHpJcbewv5PwZdCd09uISHefEjjCXadjULQXm438V0PEMT/P8Ghp8dxx8zoJHqRyDt86sl92vN/jduUg87rw5OzieY6UT70vRwFaPvnA== 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=o+wD2OlQ9bWbKD7HJUG1jwJAxm3onlW79BpaaRcJxpY=; b=Vx2DBHst3y7dGyMTThX1WfLQABxQwVeMCZptj/xjOBitLVKZJ6AFVtysruewKeNyHsd+ILmkoPSSVt0jpKWiK9MNh81n14Jqi7CE5opguOcJTLnpSPIq93eKsRSBel43GDf8hjX7w6FUotE1J2BU2a8W5R5DgcWSBJR7rzUFYHgFS0jEPS7yPgC3E7D9uxbwsn8hQDs3XNHvZ3E1QZcaWf/1D8Z7Gj4mVizp0wnJC/+mNOaFbn3OiN6I3EAtIE1XVjAJZ4nBdvdfV6M28O5cDfkH1JCyefY+8vL+fAQgVTWfp3K7RYy1zgw46wL/6oM4CEQcghuiGhpLYU3mh5764Q== 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 KL1PR0601MB5631.apcprd06.prod.outlook.com (2603:1096:820:c3::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Mon, 10 Jul 2023 06:34:08 +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.028; Mon, 10 Jul 2023 06:34:08 +0000 From: Yangtao Li To: Kamal Dasu , Broadcom internal kernel review list , Andi Shyti , Florian Fainelli Cc: Yangtao Li , linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 03/11] i2c: brcmstb: Convert to devm_platform_ioremap_resource() Date: Mon, 10 Jul 2023 14:33:42 +0800 Message-Id: <20230710063351.17490-3-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230710063351.17490-1-frank.li@vivo.com> References: <20230710063351.17490-1-frank.li@vivo.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI1PR02CA0021.apcprd02.prod.outlook.com (2603:1096:4:1f4::14) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|KL1PR0601MB5631:EE_ X-MS-Office365-Filtering-Correlation-Id: cb8ae2c8-c0b0-4cf8-d952-08db810faa06 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kmjjjf+gWpwssElq8O2LvZ3ZBLwhKZsXyQtDhobsBmpT+0/Dnq1GZvbjZQa/4j1jylYyfWEfezK3L+N+67LGOx6v98o/6bdRGI262QIxYQ81mv5WgUsuisYXjK5GLu6KbH+7/lFUsyLO+jSfkmr+colcZAUx/DdtmHYnS3aBRWlgA5dyZYKae4KqGQdtxq1xf8zP94BXgyOjpFIMFIgFV3BQYx4ELwjlhoECFUERE6sS62266DlN60ddYmQ/zaYCQc5VG/ZEn3/bqg3qrBDnZPXsHXGnRLGwHYhJKV0Wtox0gHYD1B8z5NyAH7cwl4D3kQu1o3v92C9BbmL+NUvP1QTjnXx3PbJl/EmkOmu3pfHAzIA7t3xpNKiUgW7iPbyv7we0FHBoWlpuaTui665cMmWfjwp4/+OJzJatH2++TYMzdcKJxiL/WGlpChk/EeXqYiROvpjTVIxQsLBviP2conOvtOVwNKrhmnc1MhSD2AWf1BL5wfBnRuLjqq7zILCCyBg+2uoyJUXD2f5bSMeXQ2shynFpu+MlweVn2z4KT3yMcq3BPjzfQKmuIQvZ4v1ka7wuwpwreoGU1mjgljlQBChKdjK8/Ht8YksTanCqDq2d740gZfQOWfCU7fStgB5I8AgOa1CGNJ5te9AjvDW2oA== 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)(376002)(39860400002)(346002)(136003)(396003)(366004)(451199021)(186003)(6506007)(26005)(1076003)(2616005)(6512007)(83380400001)(41300700001)(4326008)(66476007)(2906002)(66556008)(316002)(5660300002)(8676002)(8936002)(478600001)(66946007)(6486002)(52116002)(6666004)(110136005)(36756003)(86362001)(38350700002)(38100700002)(133343001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?GGA00dV2vQxbnD5byvtFMw7nxmICjKvNSV74NLc/Ieg5rsEE7obUNSwegBtZ?= =?us-ascii?Q?D97CG2ymSVBfKN964DvFhjfUHfcBh6Uuu6lRXol8i6rsCqobqILNb/FjLYT6?= =?us-ascii?Q?u2c6MzKjiTkYgSteIQEcWpKygOEgW/bMoM8V/+x1cFc3CRA2KMrqT5OxSNC1?= =?us-ascii?Q?L+bsbki7EDVkViqpSS0IWzW4Qj2YGAtHcCOzAVN66jflGRFnHfBfvOgDNxAa?= =?us-ascii?Q?+MZRx7SzyRiGX9bdzJEoV3dDEQau+e/eIm9UoUSwQtDrSwngme7Njb7fpj8j?= =?us-ascii?Q?RWsC6SSrCganSXkturAaddro3VlDMB47m/ZyneiO7b7oNbC0a30jMBbLAc/Q?= =?us-ascii?Q?wZj3Tr4P2p3SeJg02x//XMgowCsAQBtxrH/rRK1r61kKF4/0j+WqJqpp0cz/?= =?us-ascii?Q?vSICmzTiy+zZTyjN3aFFs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yc3qD8n2jmWZJ2hBpS22KUdzwx2jNzi6j68rE4ZZO9yl+soykDEUQ1w?= =?us-ascii?Q?e6ZG1XAFBz6IYvfRAL2OYmiGLuD9bOtZV3WNUsFgKinn0Ws1GFwb7EicCina?= =?us-ascii?Q?gbDyYU8UgSN95AF1i3nIAdxaIyFNirqQEn/iW1eVqQVnbxFGjMS0Hv23k+cp?= =?us-ascii?Q?nVG/Q+tIGSos30JhBnkQj0WlDLXOv8vwl8p16QlePeKd8wYYMwP4hDwQ0VI+?= =?us-ascii?Q?qY2sQUe2UlzgJ3CXpy87WQgDhYVLBbfUtvJNZYmY?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: cb8ae2c8-c0b0-4cf8-d952-08db810faa06 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 06:34:08.2731 (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: mTopqEJugnMaeQFNLrREGTERWrPjFhCJHoyPyqYfQFQHR+sZ56Q6oW97cwUpZMeJw45xDPOoUMouo2TZOlYBkg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR0601MB5631 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_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li --- drivers/i2c/busses/i2c-brcmstb.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c index cf92cbcb8c86..0d422487161a 100644 --- a/drivers/i2c/busses/i2c-brcmstb.c +++ b/drivers/i2c/busses/i2c-brcmstb.c @@ -594,11 +594,10 @@ static int bcm2711_release_bsc(struct brcmstb_i2c_dev *dev) static int brcmstb_i2c_probe(struct platform_device *pdev) { - int rc = 0; struct brcmstb_i2c_dev *dev; struct i2c_adapter *adap; - struct resource *iomem; const char *int_name; + int rc; /* Allocate memory for private data structure */ dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL); @@ -614,18 +613,15 @@ static int brcmstb_i2c_probe(struct platform_device *pdev) init_completion(&dev->done); /* Map hardware registers */ - iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - dev->base = devm_ioremap_resource(dev->device, iomem); - if (IS_ERR(dev->base)) { - rc = -ENOMEM; - goto probe_errorout; - } + dev->base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(dev->base)) + return PTR_ERR(dev->base); if (of_device_is_compatible(dev->device->of_node, "brcm,bcm2711-hdmi-i2c")) { rc = bcm2711_release_bsc(dev); if (rc) - goto probe_errorout; + return rc; } rc = of_property_read_string(dev->device->of_node, "interrupt-names", @@ -678,16 +674,13 @@ static int brcmstb_i2c_probe(struct platform_device *pdev) adap->dev.of_node = pdev->dev.of_node; rc = i2c_add_adapter(adap); if (rc) - goto probe_errorout; + return rc; dev_info(dev->device, "%s@%dhz registered in %s mode\n", int_name ? int_name : " ", dev->clk_freq_hz, (dev->irq >= 0) ? "interrupt" : "polling"); return 0; - -probe_errorout: - return rc; } static void brcmstb_i2c_remove(struct platform_device *pdev) -- 2.39.0