Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp997411pxb; Wed, 1 Sep 2021 14:52:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXh1EsAx3xPnCsl7+u1o8RIzhjXcQ0S8tWRqcfRV86SL522OHx6MUT9Y2woNwqDs5M+Me/ X-Received: by 2002:a17:906:1950:: with SMTP id b16mr1785781eje.123.1630533167043; Wed, 01 Sep 2021 14:52:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630533167; cv=none; d=google.com; s=arc-20160816; b=fKqDsYjtUNAJvvtOEShR9tAdL4X5VI9qy/uZxdAgbwbTuaF+mWgOnI2JiEUCgr9YKc Q6ShUJf6aVGrQ5acYuCLoiFodcOOnIgTVso0YCsha8/TFA66wFEiLFSfIKqCIe67F6NF Fpd/CtDsJSvYBda5r+xHPW7qvDWCIoNkDtRlAbjEYA2giymYQoC8g6Ux0/qIBZ12NruD TwrSmWgSHHfqZbpQNvQ0/pl6PEdCN1nrNyr6ayolW0F7ltjVBmjFLFsPZLN7RMjReHpG sfpRBLTJrPIJig+dOygZWWQbFNK7/B4EfnjeCDaM5F3+eqa1EyKwXVOYfvwsbg7iSGev f63A== 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:organization :from:reply-to:references:cc:to:subject:dkim-signature; bh=fBEO5QiJlZUgAac/Y4w5wDor671yrj1toMFUJvvqyh4=; b=HBSVxFnGsN0HMsIKb5T++YEvkLpoPCs1SPhXMOFpH/+cYLIzHU6vmfFO2BZt0XymLo QYphDKLfAVDGA6LDiQFPPSvZiU4Gn29Jxrta8GUKJGPfSH8UU/UNqi1iVvegBozkdDwd mtThQD7RlkMIZiwYzV2qbvUQ+/XO76kYQEsP37oiIMLfvQZs/jUo5+nYivDpmIaMLk7U qkyLCU9ssOEL4TXK7F4XtdnREi82tph9d35axEpyr5WS/1UmmSB5i9aVcHArW8hfNyKh HZPWIZxbVHM5y5qpw1W9aSvSKXRPofBMkCqiGBR1hu6VYmxnqjXsivlUM0Qy0DyQ+B1m zZtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=RptypDcj; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u2si137edy.66.2021.09.01.14.52.23; Wed, 01 Sep 2021 14:52:46 -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 (test mode) header.i=@ideasonboard.com header.s=mail header.b=RptypDcj; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240071AbhIALEb (ORCPT + 99 others); Wed, 1 Sep 2021 07:04:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232095AbhIALE3 (ORCPT ); Wed, 1 Sep 2021 07:04:29 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C36F0C061575; Wed, 1 Sep 2021 04:03:32 -0700 (PDT) Received: from [192.168.0.20] (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 8339E3D7; Wed, 1 Sep 2021 13:03:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1630494210; bh=mk3x5wM5YkkgJapxdLDMS4TyvaggxIATLYzHyiKHKH4=; h=Subject:To:Cc:References:Reply-To:From:Date:In-Reply-To:From; b=RptypDcji3LNzuNFVhgxBrOxO8wg7jriQgLnyXfSGYfjI2YLSY/VrsjpwWhDW4yuI fIRdIpYNt3chVPwczs5Uw4MhfYvb/Q/KsRggfjrncREd3rLiqJsPnABFbWZj5BBpkx vn4FfIhD3Kpp1sHW1lKllTRIcR/2chY2+4KBdI+w= Subject: Re: [PATCH] media: rcar_drif: Make use of the helper function devm_platform_ioremap_resource() To: Hans Verkuil , Cai Huoqing Cc: Fabrizio Castro , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210901055517.7329-1-caihuoqing@baidu.com> Reply-To: kieran.bingham+renesas@ideasonboard.com From: Kieran Bingham Organization: Ideas on Board Message-ID: <15a77d3a-0e2f-89e7-8d72-61856087602d@ideasonboard.com> Date: Wed, 1 Sep 2021 12:03:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/09/2021 09:19, Hans Verkuil wrote: > On 01/09/2021 07:55, Cai Huoqing wrote: >> Use the devm_platform_ioremap_resource() helper instead of >> calling platform_get_resource() and devm_ioremap_resource() >> separately >> >> Signed-off-by: Cai Huoqing >> --- >> drivers/media/platform/rcar_drif.c | 4 +--- >> 1 file changed, 1 insertion(+), 3 deletions(-) >> >> diff --git a/drivers/media/platform/rcar_drif.c b/drivers/media/platform/rcar_drif.c >> index a505d991548b..f0a1edb57841 100644 >> --- a/drivers/media/platform/rcar_drif.c >> +++ b/drivers/media/platform/rcar_drif.c >> @@ -1376,7 +1376,6 @@ static int rcar_drif_probe(struct platform_device *pdev) >> struct rcar_drif_sdr *sdr; >> struct device_node *np; >> struct rcar_drif *ch; >> - struct resource *res; >> int ret; >> >> /* Reserve memory for enabled channel */ >> @@ -1395,8 +1394,7 @@ static int rcar_drif_probe(struct platform_device *pdev) >> } >> >> /* Register map */ >> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); >> - ch->base = devm_ioremap_resource(&pdev->dev, res); >> + ch->base = devm_platform_ioremap_resource(pdev, 0); This could keep struct resource *res above and use: ch->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res) With that, (and the commit message / subject updated accordingly): Reviewed-by: Kieran Bingham >> if (IS_ERR(ch->base)) >> return PTR_ERR(ch->base); >> >> > > Compile error: > > drivers/media/platform/rcar_drif.c: In function ‘rcar_drif_probe’: > drivers/media/platform/rcar_drif.c:1401:14: error: ‘res’ undeclared (first use in this function); did you mean ‘ret’? > 1401 | ch->start = res->start; > | ^~~ > | ret > drivers/media/platform/rcar_drif.c:1401:14: note: each undeclared identifier is reported only once for each function it appears in > > Regards, > > Hans >