Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4080287ybl; Tue, 20 Aug 2019 06:46:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxI2V1xyPfyYRwqfUjoMGLeyb0YGi5e3QpjgviI9UQhEGM6IIiuDQt2cjhd4mzfIZS1MVg X-Received: by 2002:a65:4786:: with SMTP id e6mr24244189pgs.448.1566308767453; Tue, 20 Aug 2019 06:46:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566308767; cv=none; d=google.com; s=arc-20160816; b=dPR31A+dTeRkEwDyjfBwJNU/xmFnCYjPXIML42VqYEJWFlMjjOPrAd6Lzrdao8AUmv +vI0KEkUctI/x1I68RwtZlfCFgaKhZlDh7IOao0JSUMZBNTu6T7XXgCZFIyTKY9gN+HO eKRmEWEiylTWHDHr22WAcuNxPXtWBiS11JaFpaCZx+Wa5XpBD7FTmEDB7AbRGoes0CVk 2/AUDTNutXOsVSfGWbEl/2SIQ/i8+Ea3rvXlboApfJCnFsBSPQytmO3RxMStP3nHrnLx 0wY9KZrDoypgSdBfbaQa4JoUH96K6bkInniHfMqTDWzR01bQR2hCGnzZOuA3NQ5YH4e4 PKgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type :content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:cc:to:subject:dkim-signature :dkim-filter; bh=q9DQJtTXITuIpi60bahAci5B3lERTi6ynqpY7bxrP24=; b=rJw1wrq8OEwDBDKJyLC+GuG7Yof/b+i1VkCY9O0KEAVEQcRrW7WHPtId7al9hgsJnq PCm3rrI8PN0BEecIljzecSOSJQBs11ju/DeaTagie4xnE7KIBWMVvXJd/DUSF0GtY8fJ M7UcnvC0RAaDmggjlW2Ota/yI60JKA7xh/lyTI7QVU38VRo4sYTuDDlTYVgkwLGUjQyU uVNjcA2+9eA4HL73iwAOQNMW/Ykm/moPjI5SEEChYxYiE17MHM9x7LDWMN//poiXPq83 n30AY5x4B49RfoI2X21B4eHodAkwqotpLPZQmqteXvb/EKIgN2FKyCNU2LW2f5fcXJP7 CiIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=djVCe4oQ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u29si12438317pgm.325.2019.08.20.06.45.52; Tue, 20 Aug 2019 06:46:07 -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; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=djVCe4oQ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730921AbfHTNoP (ORCPT + 99 others); Tue, 20 Aug 2019 09:44:15 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:55620 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730540AbfHTNoM (ORCPT ); Tue, 20 Aug 2019 09:44:12 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190820134409euoutp02dfa1b20a7721d2565d8cae027d5d11e1~8pWshoc9L1533215332euoutp02Z for ; Tue, 20 Aug 2019 13:44:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190820134409euoutp02dfa1b20a7721d2565d8cae027d5d11e1~8pWshoc9L1533215332euoutp02Z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1566308650; bh=q9DQJtTXITuIpi60bahAci5B3lERTi6ynqpY7bxrP24=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=djVCe4oQY3nDLBvwrGShycyve/cp2B84UhbTwE9HoMewYb4/uDX3ibktbQcJUtFTu PoN6CMcFsT2K1xgk1kvT2wuCKQZcotj64wIpXJFbDFiYeCTOsgv+Qmu/4Ay4HE2tx0 i1pGqZQZEyXOtbHJyMa9U5XFUL/g5ItJ5sMcrDzI= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20190820134409eucas1p17c23db625d397514956d770ea698b493~8pWr8AITF0632006320eucas1p1L; Tue, 20 Aug 2019 13:44:09 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 74.C5.04309.929FB5D5; Tue, 20 Aug 2019 14:44:09 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190820134408eucas1p28765f1e244cccab2e61d69b2dafe8619~8pWrMQKgj1274512745eucas1p2i; Tue, 20 Aug 2019 13:44:08 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190820134408eusmtrp1491f8a7d64278aff4e4456996714eb70~8pWq9-ppI2463724637eusmtrp1a; Tue, 20 Aug 2019 13:44:08 +0000 (GMT) X-AuditID: cbfec7f4-ae1ff700000010d5-e6-5d5bf9295193 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id B8.77.04166.829FB5D5; Tue, 20 Aug 2019 14:44:08 +0100 (BST) Received: from [106.120.51.71] (unknown [106.120.51.71]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190820134407eusmtip19ae4ab7e475d7b38d06bc0809b45ee64~8pWqj9GJT2534125341eusmtip1q; Tue, 20 Aug 2019 13:44:07 +0000 (GMT) Subject: Re: [PATCH 3/9] drivers: ata: ahci_tegra: use devm_platform_ioremap_resource() To: "Enrico Weigelt, metux IT consult" Cc: linux-kernel@vger.kernel.org, axboe@kernel.dk, hdegoede@redhat.com, linus.walleij@linaro.org, linux-ide@vger.kernel.org, linux-tegra@vger.kernel.org From: Bartlomiej Zolnierkiewicz Message-ID: Date: Tue, 20 Aug 2019 15:44:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <1566304548-19972-3-git-send-email-info@metux.net> Content-Language: en-US Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA02Sa0gUURTHvTOzs6M1cl0NDyYGKwkGaUngks/AcI0+GPTBFK0pB5VcV3dc HwVhSflIWh+ZuEgZWpr5SkPXNURM3UwTRLJVirIkNVzc0CJDLccx8tvv/s/533P+l8uQikaZ B5OSlsnr0rhUJe1EdQ2vjR/2XYuLP7I2T6qefjDQqiVLFaGavt5LqO6uNxCqYdNnQjVprqFV RatGOlyunnyjV7+fekGrS+02Wr3c95ZWr3R4RctinYIT+dSULF7nH3rBKXl4yEqkV+GcOmsB nYea2WLkyAA+BuMlLUhkBW5E8GtQK/EqgmabdzFy2uIVBDPlY/JixGwb6n5ESXoDAoO9hpQO NgTmd/Wk6HbF52Cz7A8hshsOhC9zD2ViE4lrEHzf6KLEAo2PQ1lBExJvZXEo9M3mijKFD0Ld qyKZyPtwDHwcbt9mFrvASPXcttURh0G93b7NJHaHmbkHhMQHoNsmLQTYLAdLeSeSYkZAQdUK JbErfLM8l0vsCaMVJZRkaEWwUbiw4+5G0FCxSUtdQfDSMiETNyWxL7SZ/SX5BNS/7tl5Fmew 2lykJZyhv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1MHJxSDYwycVld+ROPvxAxLXiurh7Z18Op1HpIxHTR 8urwZcrdmxYyz4y5Pl1SX7Sq5Y1pv2v4EeHeN8efrM17ueXd8XeNk9v+V7wVMwzcd256VV3/ IRaGm/r/r7IITWs2FlmiH17HNPV1CefPu1oOBiyhfXN4b0czT13au7nL7cKThzuW3dOwPDzX 6bASS3FGoqEWc1FxIgDKCfCuzgIAAA== X-CMS-MailID: 20190820134408eucas1p28765f1e244cccab2e61d69b2dafe8619 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20190820123600epcas1p2dd50661f5073defeeca49b86e94ff241 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190820123600epcas1p2dd50661f5073defeeca49b86e94ff241 References: <1566304548-19972-1-git-send-email-info@metux.net> <1566304548-19972-3-git-send-email-info@metux.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/20/19 2:35 PM, Enrico Weigelt, metux IT consult wrote: > 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_tegra.c | 13 +++++-------- > 1 file changed, 5 insertions(+), 8 deletions(-) > > diff --git a/drivers/ata/ahci_tegra.c b/drivers/ata/ahci_tegra.c > index e3163da..3845c23 100644 > --- a/drivers/ata/ahci_tegra.c > +++ b/drivers/ata/ahci_tegra.c > @@ -481,7 +481,6 @@ static int tegra_ahci_probe(struct platform_device *pdev) > { > struct ahci_host_priv *hpriv; > struct tegra_ahci_priv *tegra; > - struct resource *res; > int ret; > unsigned int i; > > @@ -498,19 +497,17 @@ static int tegra_ahci_probe(struct platform_device *pdev) > tegra->pdev = pdev; > tegra->soc = of_device_get_match_data(&pdev->dev); > > - res = platform_get_resource(pdev, IORESOURCE_MEM, 1); > - tegra->sata_regs = devm_ioremap_resource(&pdev->dev, res); > + tegra->sata_regs = devm_platform_ioremap_resource(pdev, 1); > if (IS_ERR(tegra->sata_regs)) > return PTR_ERR(tegra->sata_regs); > > /* > * AUX registers is optional. > */ > - res = platform_get_resource(pdev, IORESOURCE_MEM, 2); > - if (res) { > - tegra->sata_aux_regs = devm_ioremap_resource(&pdev->dev, res); > - if (IS_ERR(tegra->sata_aux_regs)) > - return PTR_ERR(tegra->sata_aux_regs); > + tegra->sata_aux_regs = devm_platform_ioremap_resource(pdev, 2); This conversion is incorrect - despite the resource being optional we will get error message from devm_[platform_]ioremap_resource() (it always prints an error on !res condition). > + if (IS_ERR(tegra->sata_aux_regs)) { > + dev_info(&pdev->dev, "Cant get aux registers (optional)"); No need for this message. > + tegra->sata_aux_regs = NULL; > } > > tegra->sata_rst = devm_reset_control_get(&pdev->dev, "sata"); Best regards, -- Bartlomiej Zolnierkiewicz Samsung R&D Institute Poland Samsung Electronics