Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp996172pxb; Wed, 1 Sep 2021 14:50:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwesWsoujr1aNKjdSz3IbZrkE5oqbi3Nl5o4yMGdT3tzoGfBjFr79g+DgQucZOUyFu5CGNq X-Received: by 2002:a05:6402:27c6:: with SMTP id c6mr30815ede.111.1630533008523; Wed, 01 Sep 2021 14:50:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630533008; cv=none; d=google.com; s=arc-20160816; b=aLwfvBYK//n5s07GZ/FEZYOcF9UtR7hh8Xxdrn6iBhUAEdUldbWyGwmaiGY9C9mMGF CKoxzk+upiV5Z0lD3rSgBXMyTIZFJzd1YzgTv3kDnYILaDyahvDEik8if58Bo3+LqMR2 z50IYEVWxcOQVcffIJQD/iKm8XbMOUS8hIToy1b7MFtcte4BcoY2dD2H69/iHn+4ry2H 0cfYZ9dryiz90sF3HDZ4WpIaUyg67QWSkyVKJ2JpRVc6jv50rH4LK/s/4z3cQD+IZg/I uHoGDZh5j/zoTSzjgLyXHdBkB6YbCcHLnOpsOgbFViiz5TjRkb+R7Nw+jF4UlntfL8K3 ztmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=GfCHqSZv2nZlr8KsNnFiMZi9+oWhMPoyCqpwjG+OdiE=; b=aT68Fheb2vBIntydksEmosPKG5+QXSaDlvAvQDuf0FRgVjmz/F9pJUhZH9RaIG3TGV MQjmC1ahOKNalXOxqOnD5AXYDaNQASFiQqmWIKF+/2o3pOVjZETFS0VrFtP51K1S1ZrF zz+XlZWFlfelINkblfd30A6GwHn8o/g8x81TIaxRVkqm6rJDTa+7o4LtSrMO+HCqfh34 fZevI/SPwRQk1mAP7Uv6svv6Rz/5GsI1PqB8rjPo40m+rr7QIYUDAMIR7tiBRCMfHNh3 YVN0ubOXuRWuQfOTkwjbfl5bc4R/lfioL+uLLzJu3xnRYZvBFQMHAPTUzWi+jL6oggtn ZZSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xs4all.nl header.s=s2 header.b=cevdEFAB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k5si750908edv.339.2021.09.01.14.49.45; Wed, 01 Sep 2021 14:50:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@xs4all.nl header.s=s2 header.b=cevdEFAB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243133AbhIAIVc (ORCPT + 99 others); Wed, 1 Sep 2021 04:21:32 -0400 Received: from lb2-smtp-cloud9.xs4all.net ([194.109.24.26]:54405 "EHLO lb2-smtp-cloud9.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243072AbhIAIVa (ORCPT ); Wed, 1 Sep 2021 04:21:30 -0400 Received: from cust-b5b5937f ([IPv6:fc0c:c16d:66b8:757f:c639:739b:9d66:799d]) by smtp-cloud9.xs4all.net with ESMTPA id LLTumbxEylQKhLLTvmHxed; Wed, 01 Sep 2021 10:20:30 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xs4all.nl; s=s2; t=1630484430; bh=GfCHqSZv2nZlr8KsNnFiMZi9+oWhMPoyCqpwjG+OdiE=; h=Subject:To:From:Message-ID:Date:MIME-Version:Content-Type:From: Subject; b=cevdEFABsVf5kVrWj4kTmLhuAArUTVho1wy+fLzKmWs63SXLDvGQwrAyVtVDNHE08 NbJxU7ydFxjX8MfoNyolX2QvEMOXIkWasr+PeFdtnmcGAE48blnE8HVoiuZS8xNLos Socp/WsGnBRArsGpcXUwwqpk/391O4MT3IXrIdaE6itCG3i9UABvInj5a+i+3n6eTS uivaZKfWMipq3NoYlxpAjWFsYBSNSda0OJ6QvIFB0W7c9JZMgUqbP8sxczsaCrqADy 1482EOrWQYiuiIX3QJ7nAlvO+Zenvb3DIGq3QdJ7BVwGPklDUvE9cEYFDGg8x3ZAMZ YaIWuBiFE37lA== Subject: Re: [PATCH] media: sti/c8sectpfe: Make use of the helper function devm_platform_ioremap_resource_byname() To: Cai Huoqing Cc: Patrice Chotard , Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210901055631.7829-1-caihuoqing@baidu.com> From: Hans Verkuil Message-ID: <91245ea5-215f-5e60-0a97-7c29ceb7c3a9@xs4all.nl> Date: Wed, 1 Sep 2021 10:20:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210901055631.7829-1-caihuoqing@baidu.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4xfJRoayrIqmcHfdDz2ck/bNwHScVxGGQWvquTGIyrIs576AcabdctUNUbGEj+i494562eYjGHj0UVa70tJWJuO4uud54+g/wh83pgODOiGDexGiuBjZtO nMkD4naXo1NJR9paGA7PLOzwL+EwM0v0onjBBBs4Idu0huK9cyQT2OE5TzFADN11hscON0n2uglKXcknJWvzGeQ+7LPT171ViNY9XFR0TgFqoZ59AEfHYr/z dPn1Bnfks5usPN4SVihU2fH6JH2lFsNHL6n5lWWZwwNYJL/OuT8owx2rpzr8A1Q9Q13z0nvmYOsGCU2q3Tkhn4L1DTqMz/CLLCLHA0GcC+szcwSSw4NwvL+3 u88IE8f99yhumFwJXnQ4N+zwkBxgBkyHj0KpEm7g6Edd53zgXZOKzNmHndDYnm1jM6Sk8gyqEEhrIdqEsiJ7qgqZL7ErY2Api+QjQmz6yOfEPGyijIQZlwAj 1Rdqg+R7kn3AVMoR Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/09/2021 07:56, Cai Huoqing wrote: > Use the devm_platform_ioremap_resource_byname() helper instead of > calling platform_get_resource_byname() and devm_ioremap_resource() > separately > > Signed-off-by: Cai Huoqing > --- > drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c > index 02dc78bd7fab..9f05984f711a 100644 > --- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c > +++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c > @@ -665,7 +665,6 @@ static int c8sectpfe_probe(struct platform_device *pdev) > struct device *dev = &pdev->dev; > struct device_node *child, *np = dev->of_node; > struct c8sectpfei *fei; > - struct resource *res; > int ret, index = 0; > struct channel_info *tsin; > > @@ -676,14 +675,11 @@ static int c8sectpfe_probe(struct platform_device *pdev) > > fei->dev = dev; > > - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "c8sectpfe"); > - fei->io = devm_ioremap_resource(dev, res); > + fei->io = devm_platform_ioremap_resource_byname(pdev, "c8sectpfe"); > if (IS_ERR(fei->io)) > return PTR_ERR(fei->io); > > - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, > - "c8sectpfe-ram"); > - fei->sram = devm_ioremap_resource(dev, res); > + fei->sram = devm_platform_ioremap_resource_byname(pdev, "c8sectpfe-ram"); > if (IS_ERR(fei->sram)) > return PTR_ERR(fei->sram); > > Compile error: drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c: In function ‘c8sectpfe_probe’: drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c:686:33: error: ‘res’ undeclared (first use in this function); did you mean ‘ret’? 686 | fei->sram_size = resource_size(res); | ^~~ | ret drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c:686:33: note: each undeclared identifier is reported only once for each function it appears in Regards, Hans