Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3999116ybl; Tue, 20 Aug 2019 05:37:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqyYNyKFfP0GQ5B6gJtd6vbFEbsuLeiPhHLs+Obflm+7nf/pzZO3+I7Ks+HXZoSzqt/kRki0 X-Received: by 2002:aa7:9524:: with SMTP id c4mr30541184pfp.225.1566304676070; Tue, 20 Aug 2019 05:37:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566304676; cv=none; d=google.com; s=arc-20160816; b=kJTv6aqjWjCyEp+jrFVOD7IR90H4Gl8S2sJIhWFFKvXGZYuvvkoKRN+nJ3JEjwIL5b 7b4EdHid/C6v6dWmRApt5AEvxp9r3L6KR2iY8UVxK8SGPvakexFgJp6jbIuCla7+OhmW cejzbe1nD9TopcwO9NREapKBpM01ho0MKkE72oMcKPEPbZI+KWgJY+kpT6mgFpxYD4h9 /q47Z58pDWpaAA6ciNJDvCEBbGHXuj1ppacky1sHcziQvFVuAj29dVH7VZw0UYi94G8U muvuve5cJNYcVoNLXGV6ELTl1byvkh1DPTp2V3IrLqkoLVFecsc9OAgpUdjCfFaF4hdr LP4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=q48sjAmYUZA7Q5FHTbP+J/PVGWRphO4Q5RI7SsyjpSI=; b=aWiS0Z77s8SeA+WYNr+HTBBs0EbIyXz4ywfY7Nxvu+mG5MaqKVqCzI8oPV3Lz5+ONE V+AOy4AEPundoGL3n8lyHHr20ln5EVrYHOrhhgeH7VUHr8+TU8MHKPe/qQkb2Mmo6+js M17e2Cf16FkyGR1CCUqIBZpyJ/ODGaNhi9hxdZwLo9ICfFqzHKxSEZ0dzTECoto3b0sw rXA37Sr/omDUIQi/y/EleeL7CWxMjkau7Z/gmqfjRyHeQe+jaEB8nwAJSsBmBMaXI/bn mH2JEadkD7OVU2nabSIfT0g0Lv1h7O7/3iaVkXIBZr0CbLES1tWz/LObP8ZNRUVZGRnO Aukg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5si12434481plx.417.2019.08.20.05.37.40; Tue, 20 Aug 2019 05:37:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730143AbfHTMgW (ORCPT + 99 others); Tue, 20 Aug 2019 08:36:22 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:56513 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728248AbfHTMgA (ORCPT ); Tue, 20 Aug 2019 08:36:00 -0400 Received: from orion.localdomain ([95.117.23.32]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MqJZl-1icflV3Ut1-00nQ3O; Tue, 20 Aug 2019 14:35:50 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org Cc: axboe@kernel.dk, hdegoede@redhat.com, b.zolnierkie@samsung.com, linus.walleij@linaro.org, linux-ide@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH 4/9] drivers: ata: ahci_xgene: use devm_platform_ioremap_resource() Date: Tue, 20 Aug 2019 14:35:43 +0200 Message-Id: <1566304548-19972-4-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1566304548-19972-1-git-send-email-info@metux.net> References: <1566304548-19972-1-git-send-email-info@metux.net> X-Provags-ID: V03:K1:EGVdhOvit0epxFckX90tJLb4dXT1lQ105Bt+j9X+HPLLELoBJKC 1CsSnhwaJs3yJkZPHY5z3RtvocKSa/XejFWKSPl4s5dvP4piKFrpvs3Dz2b54Nzx1d3Qa4T TfimFi+xF3cZnOod8gfrP/E1u7QQb9LaoN5a8XEGdctUySujPF1z0Z66fNDJ7KXsitcOb51 cBt5WNZsemgbkUb5hFUKA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:3zvMyjGQ2ws=:GlCH8QROjQWMSD+gNDBjkm 3nKW9qtGRIICF+YnnVsDRKminnWxEVic35yRp5PGWALoIpPqK4g07PoiYAvVucHw+iuNTe80r 30KrQcaHyRS9/XVipWO2/HEaIwxtPuVOPmQUXuLd3OfBY4Y5mbLADrX0G3Vt0qMXOFNfy5qIZ WEmMr/eeQU/YrbI1rT7KogjaVlBY/ni0c5rx9QH8E9djEn2Uz1LJYKNWlDj21C7zYjey6Y0BG vZDoZQmPeivZU858Zs+EfQ7EIf0fPRrnIi2IeNpTrnLrMu//fvyM+4G+W8AcHnISJJ0BeQDT2 yc8RI7VRg6O8wFjc3iuDiHq/JHlEcO9qsnv9a/nccXJ0nELHzppweCZpdxF/5ZN0gaf4FASsr DwdxMyAuG7A1oka8Pcb/NSGwuOSSNLNUheJSPmdRxN07iBDzrcNe6AuoD3voqpoCQpavTxzd6 R0lnOn3KRmmxISNn/W6peNdQ6MAS1qgcO+U3l5MmBmb29KN+1gQp1rv55zH7AuZW40+x2pJsG aljzXQIbGmdiyMXDK20FhCfKLl+kR8oW3bUYExnvpdpApCO2HbeLTEdtyU0eAHL5DNZlrd1e8 mzKGtATAdrjhHVUzkzqdS20O9sdL2TP673RoobgeeKsWlM6XRjkljM++lkHQ3InWJM3+oNcna GhDvzds8eS4iz0rSG+pShpYAFcSFm1kv3ffKjKcdFLlR8GcjODoyThzjbglPbkujLZ5nCj5hb I1BPfBSSypmImS/vza0t5LPyF+ANdxhbqdqB0w== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together. Signed-off-by: Enrico Weigelt, metux IT consult --- drivers/ata/ahci_xgene.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c index 16246c8..5391f5d 100644 --- a/drivers/ata/ahci_xgene.c +++ b/drivers/ata/ahci_xgene.c @@ -739,7 +739,6 @@ static int xgene_ahci_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct ahci_host_priv *hpriv; struct xgene_ahci_context *ctx; - struct resource *res; const struct of_device_id *of_devid; enum xgene_ahci_version version = XGENE_AHCI_V1; const struct ata_port_info *ppi[] = { &xgene_ahci_v1_port_info, @@ -759,31 +758,25 @@ static int xgene_ahci_probe(struct platform_device *pdev) ctx->dev = dev; /* Retrieve the IP core resource */ - res = platform_get_resource(pdev, IORESOURCE_MEM, 1); - ctx->csr_core = devm_ioremap_resource(dev, res); + ctx->csr_core = devm_platform_ioremap_resource(pdev, 1); if (IS_ERR(ctx->csr_core)) return PTR_ERR(ctx->csr_core); /* Retrieve the IP diagnostic resource */ - res = platform_get_resource(pdev, IORESOURCE_MEM, 2); - ctx->csr_diag = devm_ioremap_resource(dev, res); + ctx->csr_diag = devm_platform_ioremap_resource(pdev, 2); if (IS_ERR(ctx->csr_diag)) return PTR_ERR(ctx->csr_diag); /* Retrieve the IP AXI resource */ - res = platform_get_resource(pdev, IORESOURCE_MEM, 3); - ctx->csr_axi = devm_ioremap_resource(dev, res); + ctx->csr_axi = devm_platform_ioremap_resource(pdev, 3); if (IS_ERR(ctx->csr_axi)) return PTR_ERR(ctx->csr_axi); /* Retrieve the optional IP mux resource */ - res = platform_get_resource(pdev, IORESOURCE_MEM, 4); - if (res) { - void __iomem *csr = devm_ioremap_resource(dev, res); - if (IS_ERR(csr)) - return PTR_ERR(csr); - - ctx->csr_mux = csr; + ctx->csr_mux = csr = devm_platform_ioremap_resource(pdev, 4); + if (IS_ERR(ctx->csr_mux)) { + dev_info(&pdev->dev, "cant get ip mux resource (optional)"); + ctx->csr_mux = NULL; } of_devid = of_match_device(xgene_ahci_of_match, dev); -- 1.9.1