Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp821000ybn; Tue, 24 Sep 2019 10:01:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqxtQMOFT8Pp06sOgcs0PO1MuNgQ418GsI/WC+db69/BFALzRkQ+42ALKD+VB9sJu2C3/TBv X-Received: by 2002:a1c:4c12:: with SMTP id z18mr1160550wmf.45.1569344488108; Tue, 24 Sep 2019 10:01:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569344488; cv=none; d=google.com; s=arc-20160816; b=YpHVtm0PpoUOME/rHkURFcxMX06lD8efN3o0E4f6uC1MJs/Am1Ps32rVyH5njH9JDo a76S/qcwc1fQQwIhyJxs8FkKbHMMiK/igmewy5W+k8X2sslXRN/jR8UadP2Tdjsftk2q WVUFEGpCwdF8MwXa7JZc7dk/I+9lW/Kpse1+smS0Olyo6JsIsLpsNs2z0iengl/eqsLs WiR1Rt0XR5iOiZ6gIPvmymojwdOvrwusI+UBqZPlvWzhdVCxRsH+qRYyYkgXNS18Jh19 Rm4kBZGSnxyVIDiYHfYTjU5CAz1a4duCZCeCN9zSHF3RRkP0zX/QFTZqHxMYhLu9B1bA Ww4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1iHVMQKqhTvi2xyeEpHSWZnbXdJb6BZcBgLx05z/RJY=; b=kWECi7Y0JazLRjSYsYUlZRlHLf9J70oiR9wHKMq3us9OjVrzWxd+iLGXAQ37de2YLD toxLOxjq9CHbB1uzmYABzLZX7FoTwinXGXKBnPil1nDa1kEar49FEIcU0ygbizZQHWlb RxKa2daBB4w9xFJRdJy6PQ9ClwAiyPXLGch1yev6Do1zQoV8JbwjKo4hlpo/PSSLd00s rshdbp4fO9cKs/LjJgMzkcufISYRPS37GsTu8xSRBsITsUCYDSMPWH8diyf7DMiKeWrt itYy+44EsBd+ghsIRSmWUmCm8qapaf8GEtVNSFuxBhDNz9PmFnNe1UTdgnijJuT/2UCJ Illg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ragnatech-se.20150623.gappssmtp.com header.s=20150623 header.b=zAsyPvNJ; 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 bt6si1502743edb.69.2019.09.24.10.01.04; Tue, 24 Sep 2019 10:01:28 -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=@ragnatech-se.20150623.gappssmtp.com header.s=20150623 header.b=zAsyPvNJ; 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 S1730215AbfIWLeH (ORCPT + 99 others); Mon, 23 Sep 2019 07:34:07 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:33351 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727145AbfIWLeH (ORCPT ); Mon, 23 Sep 2019 07:34:07 -0400 Received: by mail-lj1-f194.google.com with SMTP id a22so13361957ljd.0 for ; Mon, 23 Sep 2019 04:34:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech-se.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=1iHVMQKqhTvi2xyeEpHSWZnbXdJb6BZcBgLx05z/RJY=; b=zAsyPvNJsGYcnnQeTbbprStzO4yMGANU4Wwf8P25L0D1n7azLLG750ich1xVRaWDAW IyAmTFGaVwCJP9xiUik/8q1b66zr5cFf/PG4QRArX19JS2/PwOhFis27q9CH5IQFsysc IgjgN8DM+EhVr1ffjmOsBsngMuGC94o0StTmi8fH6jmvYVS/LlBjgjM+UkpoZerHGp6z LXaU9ZShi7/y/Ab2WMrtyF6IRiCp2pmUvmooh3KCl4I4dI7zDmL/n2AFYqE3OsIifJyt 6xY4M3QgfFH8s4DCfBRwSCg7ZbiUvuwl9kfgIS3JzDNAIos56QJeqRygXAFE+sMLd3YD aIHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=1iHVMQKqhTvi2xyeEpHSWZnbXdJb6BZcBgLx05z/RJY=; b=ZVttwri01LRprT+vuJI+AxrW3ULvgqO0L37aSlwOEVhi47tT6LJdaXH3J75UlB0+Um QJWgYdqomt4pBdr2DYv/xmnn8OUxo+s07Le+gfAP1AMoWtSmBYxmPTYjgLW4rW+aNi/r Gq8ilunO48FUrnmh6wtvlfbga8xvSK1KD3PMoPUtUgLFsNfmBLoUGZAD+VT6RoHGYnbQ 1vtoeRIbqJwOlXgEtqCpgU2AQp/VhxtJTHZPxb+tooh0ifVSrUNEcLIrmdKYWyyMbSBg LMrTjmPfmgxZrhz64mgdz3HjJZYN1l8cvezU8DNhjXco6Evs6vjKIePCVe31e3zyuXPV mysw== X-Gm-Message-State: APjAAAWoAUYFbu+MlV7+wXJT7rySYJ1OXNuRTvsmBZCFh2tigEG4w3Zz Mz6/MIETRUTUKwnr0QvvKBFr8A== X-Received: by 2002:a2e:8789:: with SMTP id n9mr17263051lji.52.1569238444804; Mon, 23 Sep 2019 04:34:04 -0700 (PDT) Received: from localhost (h-93-159.A463.priv.bahnhof.se. [46.59.93.159]) by smtp.gmail.com with ESMTPSA id 126sm2326083lfh.45.2019.09.23.04.34.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 04:34:04 -0700 (PDT) Date: Mon, 23 Sep 2019 13:34:03 +0200 From: Niklas =?iso-8859-1?Q?S=F6derlund?= To: Markus Elfring Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-renesas-soc@vger.kernel.org, Andrew-CT Chen , Matthias Brugger , Mauro Carvalho Chehab , Tiffany Lin , LKML , kernel-janitors@vger.kernel.org, Bartosz Golaszewski , Himanshu Jha Subject: Re: [PATCH] media: platform: Use devm_platform_ioremap_resource() in two functions Message-ID: <20190923113403.GA14837@bigcity.dyn.berto.se> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Markus, Thanks for your patch. On 2019-09-18 11:30:30 +0200, Markus Elfring wrote: > From: Markus Elfring > Date: Wed, 18 Sep 2019 11:20:48 +0200 > > Simplify these function implementations by using a known wrapper function. > > This issue was detected by using the Coccinelle software. > > Signed-off-by: Markus Elfring > --- > drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c | 8 +------- > drivers/media/platform/rcar-vin/rcar-core.c | 7 +------ For rcar-vin: Tested-by: Niklas S?derlund > 2 files changed, 2 insertions(+), 13 deletions(-) > > diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c > index 00d090df11bb..944771ee5f5c 100644 > --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c > +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c > @@ -253,13 +253,7 @@ static int mtk_vcodec_probe(struct platform_device *pdev) > } > > for (i = 0; i < NUM_MAX_VDEC_REG_BASE; i++) { > - res = platform_get_resource(pdev, IORESOURCE_MEM, i); > - if (res == NULL) { > - dev_err(&pdev->dev, "get memory resource failed."); > - ret = -ENXIO; > - goto err_res; > - } > - dev->reg_base[i] = devm_ioremap_resource(&pdev->dev, res); > + dev->reg_base[i] = devm_platform_ioremap_resource(pdev, i); > if (IS_ERR((__force void *)dev->reg_base[i])) { > ret = PTR_ERR((__force void *)dev->reg_base[i]); > goto err_res; > diff --git a/drivers/media/platform/rcar-vin/rcar-core.c b/drivers/media/platform/rcar-vin/rcar-core.c > index 6993484ff0f3..334c62805959 100644 > --- a/drivers/media/platform/rcar-vin/rcar-core.c > +++ b/drivers/media/platform/rcar-vin/rcar-core.c > @@ -1282,7 +1282,6 @@ static int rcar_vin_probe(struct platform_device *pdev) > { > const struct soc_device_attribute *attr; > struct rvin_dev *vin; > - struct resource *mem; > int irq, ret; > > vin = devm_kzalloc(&pdev->dev, sizeof(*vin), GFP_KERNEL); > @@ -1301,11 +1300,7 @@ static int rcar_vin_probe(struct platform_device *pdev) > if (attr) > vin->info = attr->data; > > - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - if (mem == NULL) > - return -EINVAL; > - > - vin->base = devm_ioremap_resource(vin->dev, mem); > + vin->base = devm_platform_ioremap_resource(pdev, 0); > if (IS_ERR(vin->base)) > return PTR_ERR(vin->base); > > -- > 2.23.0 > -- Regards, Niklas S?derlund