Message ID | 20230706092047.18599-3-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 v5csp2426663vqx; Thu, 6 Jul 2023 02:30:58 -0700 (PDT) X-Google-Smtp-Source: APBJJlGfY+LrWiUY0tcEFjsHZE+vfO188L7xBkfUx7Hz8QDKZvkkhw5g1i1E3TmeEWdo4k4evnBz X-Received: by 2002:a05:6358:52c8:b0:134:cac4:b88f with SMTP id z8-20020a05635852c800b00134cac4b88fmr1646645rwz.16.1688635858411; Thu, 06 Jul 2023 02:30:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688635858; cv=pass; d=google.com; s=arc-20160816; b=DT+VE6uWVtkusSLZE9wkSbu94oCFNcKYR5wTNnv2fFoQkpf53Hi7Tg36M5WtIC87F3 eY5IXYcuuCbKJQEyWPu4vNvz+dcUaKxQ3WnPYtHh7IwHRJgwWLZr58M81UmQ3NT4j3VJ vbVHgoA0cCkcF+mBjQBnef61i1yd2WP4eg/tqFIAUewdyUvnG37ffuxUVMMLEhDW/ScS 1cq9Z5oGy6q/7r8iR5lCgFcvkU6pJh82dbj1/9OBIYwV9yhA5QnYRO52wBQ4219y2Ibt i4wk6Zpq3urMNqwJq0wqcwPRcAunbNDyaLE41oJm0teVClIKMiuAeRHCH8/4U9pW8cfQ dNRw== 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=2OX2vGAet7PpI5x6PD205cmO+y21lSocNiCDk59Mgp4=; fh=PqAAl+somsTX7X23AipoAHBADIOZcmtBC2nR6Dvt5ss=; b=kpmeIuZEPuVaNWIMkTJsj6qAhE+UZO59bRemxkLU0YJYEVQkPNB6v3g9nGuPl0DBhM VBGyYprc4RNtgCJ+vUqZLVcDCufHKGNQlvmevxD8rTZmsbtXhZp5pk9K6zP8Iz7Pbty8 ZKRpgqB3VIwJzjyfxuSAtkOxCbk39/bRKXha+2fckn7LkhONhofTIG38na95AbJHaYOf YrSNODXOfsObaY2IJGYqhdegJze5D7Q8d86pNhItPJS3qvebkW+Brf/Z8IrW47xN5rg3 7D7GC3a+7MEQkP6NYhYwpK/4Hwxml6Vj21wjtudoGeSatfTsvb04Qc81X+cc3CHjAtpQ NyKg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=n+P3xP23; 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 j192-20020a638bc9000000b0053b8c964128si1077910pge.708.2023.07.06.02.30.43; Thu, 06 Jul 2023 02:30:58 -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=n+P3xP23; 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 S231972AbjGFJWY (ORCPT <rfc822;hadasmailinglist@gmail.com> + 99 others); Thu, 6 Jul 2023 05:22:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231906AbjGFJWT (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 6 Jul 2023 05:22:19 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2118.outbound.protection.outlook.com [40.107.117.118]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90B4C1FDB; Thu, 6 Jul 2023 02:21:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mtGEtoyHaiS4JgftmQEqOMwQDsRca3rX8TdSaFMiX3XwuYGIBUkjGZ9RzIxEjLBxDImvsgU1uGQN8kW87LiBTieJqv5nk5rwQaoBm28AY2gr/ru821ZzFpR2ck7Nc7He8kPF2G+fNdcjjSIzmF/yQB/jretputMtbX6QPbaXkVBOqGg/G4JBjbKR2BMCkhQ8/7qQHaScax+1SLsbU+DY4y73MWN8TGh/tfFNMy7Sk4nPVv1fv+6rol847MaS2A62fNpiIMTkPUBlh00XDcqhGvTnj0aCRnIAKLPoE/B9zkwOCk7yG7g2M/OwuxN/9uPhpC/XtIhJ+KbEa6+D3IfwdQ== 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=2OX2vGAet7PpI5x6PD205cmO+y21lSocNiCDk59Mgp4=; b=LS7UJd/nmQWCtd6gynQEZYSfKlmtXoJZk1OG6JW5kqiGLyJhzS1tvkPBOrdxPrtpve62TD7Nml9+BCejb/JGpWipUt89tH1j9q8mob4N8ZTPLfwqBRNVnc7v6fUL8+jY6qwRKFkOaJfbbMAAVau6Aj6q0sIavXC/8KoCZ22edyccdwmcGQsQDxGnTpbq/juaiMngGr89g1loHKqsgrBy4cyuXGrTOEtBKyNcK3Ebp7PNtA7D1imOCUedkqNCzMmEZx2cowO+73zpCN/SrZ7xgJ1DxgI19xbFVhr9uqM4wTxYR5de1TsC3Df8l0JTjsEhEwPMWDE6Le2HoAFq/xyY9g== 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=2OX2vGAet7PpI5x6PD205cmO+y21lSocNiCDk59Mgp4=; b=n+P3xP230pcpfUmwXX++qgn0EqA3OLcmOK0mCGYXh0jbGi4TGrElmFeshGuUL4zcWKgTWSd7UZWxxirf7ysFsJXbOe2ANAG8Pob1gB60vvV6I3W1BqSkEsVYSDK4clrXVL6QXU+vz7zk2ieQUSMYBSqQWJDq+mtQfwEdEf+tZvVDCnvM5dJfqyjZtio/BU6PL9s6kAZ7zfIhrPJaekTCb9xLLIGqZjD09xiDL6Ev4ervLFMgxnJyMhDrK3lKGy8vKZuqepm18/hsrIPoLOGeB4Kcek4g6ZDo3vTOkMrkmQHL7OnfzTKxKphstsGOOSHjwalqt8OEFzLpRwvEbrQYMw== 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 TYZPR06MB6378.apcprd06.prod.outlook.com (2603:1096:400:419::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.37; Thu, 6 Jul 2023 09:21:02 +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; Thu, 6 Jul 2023 09:21:01 +0000 From: Yangtao Li <frank.li@vivo.com> To: Linus Walleij <linus.walleij@linaro.org>, Lorenzo Pieralisi <lpieralisi@kernel.org>, =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= <kw@linux.com>, Rob Herring <robh@kernel.org>, Bjorn Helgaas <bhelgaas@google.com> Cc: Yangtao Li <frank.li@vivo.com>, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] PCI: v3-semi: Use devm_platform_get_and_ioremap_resource() Date: Thu, 6 Jul 2023 17:20:45 +0800 Message-Id: <20230706092047.18599-3-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230706092047.18599-1-frank.li@vivo.com> References: <20230706092047.18599-1-frank.li@vivo.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI1PR02CA0035.apcprd02.prod.outlook.com (2603:1096:4:1f6::8) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TYZPR06MB6378:EE_ X-MS-Office365-Filtering-Correlation-Id: dab93279-957e-48db-03c8-08db7e025108 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b7GPygDXM3/poUomjcxR1sPxHI3u4yLysArMr04G/Z/wTjPcJXk9iD8+oeVKkaT2Z2Naqj3gWl+eO6RcR2fifsEzvfjhFKWJyp4QniQqX3BbH1ebwx8AebilIraoDpqBIHJojAvk95ZAvL4nKVQtJPyV1i9IVH78iM9eb3kQnIc5xl12q4FCnkJPCxnH9VHKwm5ZI8HPUWITsuzfpPVNTD1ljeD1BCM5CvQ+DAbpJ2Q+gLZlfKfi7X+ujnmEa87JagDqC+Vn8OqlhKIuf2mh3R1+Acba91iSmdDPPHvduJZoVCzDorQRjbkN+Z7wYpzI+EwgxS1xQyH5MSr1ypKkc+EsDMAp4ev2+uojilJo7BZUc8QFQtNQZqXHfX/Z3GiJZb3TMl2QUZbVHf7NyNL9/iBLEtrlnbvKI5gqO2LxxFcIKKPEwjaU1Qt5eRoKxJZBP0PxIuSBVYYL/CUk1+lWJdwraNzsSaQU52/OzR9ybSaSgcWsc9teGqAYP8JWjH89fUKJttbl9oJRYJ39gZBvSHTnTVWUCoZ3Z1cLG6OHxaEedMKIlImVp2zQTqiyqHRgiTVoXxBC6BzvtyhHH0XGlejak5CaD+HfQ9hwVoTtGrM7d7BJ34t4hd33fgWPzS4s 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)(136003)(346002)(366004)(376002)(396003)(39860400002)(451199021)(1076003)(6512007)(66556008)(4326008)(66476007)(8936002)(66946007)(316002)(36756003)(5660300002)(8676002)(478600001)(2906002)(38350700002)(110136005)(26005)(86362001)(41300700001)(6666004)(6486002)(83380400001)(6506007)(186003)(38100700002)(52116002)(2616005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Cmdb1WkQjGE1CVfDihwVEu55A5Vz1joLpRA/YBYgENdRX5lwNQ+UQuD+Ulz8kjqH9z1ZgEVNctV6wlSn3Npu6OTTWo4ll97VLKi1MWlMAWJS8bcA6TrOOMpIP9/jo9kazIaidp1izEBB1qDQzDBXnMeL2b+V0LODjs6NkiQ7fG0kYtjCEoykzGZ2LkjRCZ6MQ3ifayCqsqCp5JtSs6SUyuofe0kekU/WBplE0dDEg02042T7M/PXGwg8EugDdUix0D/gNBa62U3wKSAFyD0mFZjc+X2+srplYPPlMltag1MceE1r2crRGxXjSlP8l+Y8z8mMiV5PG2eH7nZr2J0RFzASvke8CW8Jk9dcVjrE8HKzNN9mgPuwHulEXXQUdNZe4p6PQPVwSk34LWvP1kf2cMwBAiE1gwMwHHsyLY6+pd6AAtQIyEBAzpH43e3CkXeGfmr6I0FmaJyGjK07/Cj5NrOSRhY87Um91JOI7BYEVZRrhEe+Y5vbZkq7SJDVkUAWSYy0YQjiz/+gjTW8Nnl0xB605vU1KPCmzQeaVSuRRMv+SqF5AYSJYCbcEwioqHkUJoWMeeoLLRo6l6N2//Th4+X65V7lySKfF7Lnr9zrFf3+x0kL22JWFyd57jPmjcVRhC0fKh2Ae3+WxmavDwtf47bUVMkbmZL7RC58IE6yrmuFlvc3zJf0MutsXGlThbkbQy0boErcDVLLc+oZf0YowqrpKbOY+N+QPNbzQvLcjgwnNi/ssH3cT1rOUYcXhgoZKq3qy12+cWJOjGGHfzUqrnFA+KlhjvDmP8K1+tXhzA54eMMRrAPsMW4RC9Mk6c+/SdDVS8nX+5Ts+CJjAz6+Y6Q1BG6CWWayQZEb2ANhHTf7EuV48D/rEjcbvf+hvm/i/xSQLT/zr5CRZLQyG3HT35WRyDn92DX5dfROhJjW4fX2ZWN9S3KAtThvRkm82QJfdiMORLb9qJYxwPYdnU+zRkzKpkQPWn9M0yym6MK+tm86fUUJHF49YV5YKpacdCkeD6P49CD8wH0RoVMnLpK7r0VgvjjFHrsglqshI2zjp2KJch3Y9ILnZW8NkU/G6iMq6hC/Ky8GLE9jkJRJuAdKUvuQb6h8cFjwZT4VRpcdaEzc808z9CtcuSFJ0rydk+Ao9W89Xpq3u+vReejnfakLmntXrzGEZsWgsiqPwP+PmezN7SZU3Fq8h7svy18FeyKwlhUEpUJHudYG5mEe7yRZDBvrU2yiy8AR75bVxQAREVwToLgts6B6RsiFwPVbdIiVl9N52MfAgWTdbBN1ypA1yp5JH2AN2K6xO5ORYVIQ6s7pkh2z4Hw7ouaz9qHAMcrOG7pb32H4yVgJ/V43qk6aZYavEyGeL3g2ctGqJ8dBYvc17pEtpZkKB8fQP1g+QGl1QcZvBjpH3NGC4vsru/WNlmpDniM9iJ0a1ck0K7aGHSZfXd9m6gmJk5L81MpHuuyLzgowGz9XHgjPVoVUKhOvdKg8isny7zEmtz4VYJhdleE4WsXQgvTFQB53rhI+Wb4DFffFZ3fBBGO8oFOifKKiHpAO4as6OVUEdna9zScN5xIQCLHCudARt3h8E0XKwmXT X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: dab93279-957e-48db-03c8-08db7e025108 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2023 09:21:01.8952 (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: CFx+TzGHwVrcp0G/WhqiACMOuOoo+yM1niQTxfv7W8BufYACNvPVKc9+wjRLlHkQ/unr4FveTm3th+lOeXJNWw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB6378 X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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?1770663033520737033?= X-GMAIL-MSGID: =?utf-8?q?1770663033520737033?= |
Series |
[1/4] PCI: imx6: Use devm_platform_get_and_ioremap_resource()
|
|
Commit Message
李扬韬
July 6, 2023, 9:20 a.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/pci/controller/pci-v3-semi.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
Comments
On Thu, Jul 6, 2023 at 11:21 AM 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> Looks correct. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Yours, Linus Walleij
[+Cc Yang] Hello, > 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. A very similar series was posted a while ago. Patches 1, 2 and 4 in this series are identical, except for this patch, which adds one more very nice refactoring, The other series: https://lore.kernel.org/linux-pci/20230626110226.GA569947@rocinante What I can do would be to pick this patch and squash it with the other ones that are already applied. I will then attribute both you and Yang Li as the authors. Let me know if this is fine with you, Yangtao and Yang. That said... > diff --git a/drivers/pci/controller/pci-v3-semi.c b/drivers/pci/controller/pci-v3-semi.c > index ca44b0c83d1b..0f993328dba2 100644 > --- a/drivers/pci/controller/pci-v3-semi.c > +++ b/drivers/pci/controller/pci-v3-semi.c > @@ -736,8 +736,7 @@ static int v3_pci_probe(struct platform_device *pdev) > return ret; > } > > - regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - v3->base = devm_ioremap_resource(dev, regs); > + v3->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); Are you sure about the variable name here? This might be a small copy-and-paste mistake that snuck up here. Have a closer look, or better yet, try to compile and test this. :) > - regs = platform_get_resource(pdev, IORESOURCE_MEM, 1); > + v3->config_base = devm_platform_get_and_ioremap_resource(pdev, 1, &res); Same as above. > + if (IS_ERR(v3->config_base)) > + return PTR_ERR(v3->config_base); > if (resource_size(regs) != SZ_16M) { > dev_err(dev, "config mem is not 16MB!\n"); > return -EINVAL; > } > v3->config_mem = regs->start; > - v3->config_base = devm_ioremap_resource(dev, regs); > - if (IS_ERR(v3->config_base)) > - return PTR_ERR(v3->config_base); This could be made such that the assignments are together. Krzysztof
On 2023/7/7 2:55, Krzysztof Wilczyński wrote: > [+Cc Yang] > > Hello, > >> 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. > A very similar series was posted a while ago. Patches 1, 2 and 4 in this > series are identical, except for this patch, which adds one more very nice > refactoring, > > The other series: > > https://lore.kernel.org/linux-pci/20230626110226.GA569947@rocinante > > What I can do would be to pick this patch and squash it with the other ones > that are already applied. I will then attribute both you and Yang Li as > the authors. Let me know if this is fine with you, Yangtao and Yang. Acked-by: Yangtao Li <frank.li@vivo.com> Thx, Yangtao > > That said... > >> diff --git a/drivers/pci/controller/pci-v3-semi.c b/drivers/pci/controller/pci-v3-semi.c >> index ca44b0c83d1b..0f993328dba2 100644 >> --- a/drivers/pci/controller/pci-v3-semi.c >> +++ b/drivers/pci/controller/pci-v3-semi.c >> @@ -736,8 +736,7 @@ static int v3_pci_probe(struct platform_device *pdev) >> return ret; >> } >> >> - regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); >> - v3->base = devm_ioremap_resource(dev, regs); >> + v3->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); > Are you sure about the variable name here? This might be a small copy-and-paste > mistake that snuck up here. Have a closer look, or better yet, try to compile > and test this. :) > >> - regs = platform_get_resource(pdev, IORESOURCE_MEM, 1); >> + v3->config_base = devm_platform_get_and_ioremap_resource(pdev, 1, &res); > Same as above. > >> + if (IS_ERR(v3->config_base)) >> + return PTR_ERR(v3->config_base); >> if (resource_size(regs) != SZ_16M) { >> dev_err(dev, "config mem is not 16MB!\n"); >> return -EINVAL; >> } >> v3->config_mem = regs->start; >> - v3->config_base = devm_ioremap_resource(dev, regs); >> - if (IS_ERR(v3->config_base)) >> - return PTR_ERR(v3->config_base); > This could be made such that the assignments are together. > > Krzysztof
diff --git a/drivers/pci/controller/pci-v3-semi.c b/drivers/pci/controller/pci-v3-semi.c index ca44b0c83d1b..0f993328dba2 100644 --- a/drivers/pci/controller/pci-v3-semi.c +++ b/drivers/pci/controller/pci-v3-semi.c @@ -736,8 +736,7 @@ static int v3_pci_probe(struct platform_device *pdev) return ret; } - regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); - v3->base = devm_ioremap_resource(dev, regs); + v3->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); if (IS_ERR(v3->base)) return PTR_ERR(v3->base); /* @@ -750,15 +749,14 @@ static int v3_pci_probe(struct platform_device *pdev) readl(v3->base + V3_LB_IO_BASE), regs); /* Configuration space is 16MB directly mapped */ - regs = platform_get_resource(pdev, IORESOURCE_MEM, 1); + v3->config_base = devm_platform_get_and_ioremap_resource(pdev, 1, &res); + if (IS_ERR(v3->config_base)) + return PTR_ERR(v3->config_base); if (resource_size(regs) != SZ_16M) { dev_err(dev, "config mem is not 16MB!\n"); return -EINVAL; } v3->config_mem = regs->start; - v3->config_base = devm_ioremap_resource(dev, regs); - if (IS_ERR(v3->config_base)) - return PTR_ERR(v3->config_base); /* Get and request error IRQ resource */ irq = platform_get_irq(pdev, 0);