Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp175218ybl; Thu, 12 Dec 2019 16:05:04 -0800 (PST) X-Google-Smtp-Source: APXvYqzWsBlIVKNdNe0Lw85psWGMv8jDRhX3bNJ9eiugyCJJoB5DIS1nNwhahY7Pq2lEkbaDQopq X-Received: by 2002:a9d:191f:: with SMTP id j31mr10958915ota.163.1576195504237; Thu, 12 Dec 2019 16:05:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576195504; cv=none; d=google.com; s=arc-20160816; b=HXdTN/aa6XhVT7ZK0IvQPX9MIHnzAJoaZ7oEwWiQE2TYGqjNWrkHLrcAj6N4jUFHc0 sixpcRCzu0gwpKDxKzxboyqWeAS21HpNh9CFyJf8C64aRkC9O0lK3J92w+0MJy7pD8Yk pozvD4V5lztpqxDo3ygxz4BDv2Sdwq7YnkIvxUL3GEG5lhiLFea1hhiKtznh+d9SbKhw 5wLhx7ix4qNCgJe5w36weDHjZpTVvWXgzYTDBqsPtkGER34qC9g/TsK0Ul+VdsMtZnD4 iwYK0cqUkeo9qWeQGlTuHTXlp7T7Gzwt/7vtopqffJvqoK1kJwiJ0G1cUjEq8/T1mFo0 8Ixg== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=7eXuDHxSP9I+eOcpW2WjmvMZVFGubP+kHAeLFKNSCxk=; b=mCg9twmk2qJ9DChclME6P73JukIwbexmlh6S61B1M/iTgRz5D7tUH1FOqhoSoogVko 7j6NDUW7WhY64EvbnIuuKcKlTEUQyvnn4CeK9SY2tYM2Sa7D9N0CPJHqJl7dFXacL+Co CzFuZfXUMcUUN/eyAkbR8tyzT7NZuF29hip/UlKLkUqMxAXt77Y28PAsr5/ugHW4H1I5 uILw8dcfpeFx6fbZcKhoduFQhIyS2b60H2uoh0es+WdqK9Pl2QqS7hI1kX1b0sCUVH6G i5pxFTZT5vkOvDzfY0rC89OEGt+Iot9Fuy4adHm6rWsbcg04UMrE2JnkAaHtq/+AsvBx INYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=RndbV6MA; 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 q12si4058054otm.261.2019.12.12.16.04.48; Thu, 12 Dec 2019 16:05:04 -0800 (PST) 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 (test mode) header.i=@ideasonboard.com header.s=mail header.b=RndbV6MA; 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 S1731270AbfLLXm3 (ORCPT + 99 others); Thu, 12 Dec 2019 18:42:29 -0500 Received: from perceval.ideasonboard.com ([213.167.242.64]:56574 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726427AbfLLXm2 (ORCPT ); Thu, 12 Dec 2019 18:42:28 -0500 Received: from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2E677A2B; Fri, 13 Dec 2019 00:42:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1576194146; bh=Zigp7SWN2m4H6YUkBIdGVKmC/isQiYmdYdZtzt8Jztk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RndbV6MA+dGWmvZ8wzqXHSiv1XkHg7/dIXqIHfZSjpsohZe7cAXRD4W7DRtNJD5gq TAoQleBsM/vUVrxVAWvJ4bd1I49mwSPfuqw8FZRBq3naYfcCwFG5mnizDN/yy62WUT icU0UJEstnAAbSa74Yss0oOgUmaBCzv4t9St5zs8= Date: Fri, 13 Dec 2019 01:42:16 +0200 From: Laurent Pinchart To: Chuhong Yuan Cc: Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] media: omap3isp: add checks for devm_regulator_get Message-ID: <20191212234216.GE4892@pendragon.ideasonboard.com> References: <20191210091428.23448-1-hslester96@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20191210091428.23448-1-hslester96@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Chuhong, (CC'ing Sakari Ailus) Thank you for the patch. On Tue, Dec 10, 2019 at 05:14:28PM +0800, Chuhong Yuan wrote: > The driver misses checks for devm_regulator_get(). > Add checks to fix it. > > Signed-off-by: Chuhong Yuan > --- > drivers/media/platform/omap3isp/isp.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c > index 327c5716922a..ef3502182c3a 100644 > --- a/drivers/media/platform/omap3isp/isp.c > +++ b/drivers/media/platform/omap3isp/isp.c > @@ -2312,7 +2312,16 @@ static int isp_probe(struct platform_device *pdev) > > /* Regulators */ > isp->isp_csiphy1.vdd = devm_regulator_get(&pdev->dev, "vdd-csiphy1"); > + if (IS_ERR(isp->isp_csiphy1.vdd)) { > + ret = PTR_ERR(isp->isp_csiphy1.vdd); > + goto error; > + } > + > isp->isp_csiphy2.vdd = devm_regulator_get(&pdev->dev, "vdd-csiphy2"); > + if (IS_ERR(isp->isp_csiphy2.vdd)) { > + ret = PTR_ERR(isp->isp_csiphy2.vdd); > + goto error; > + } Those regulators are currently checked at runtime in omap3isp_csiphy_acquire(). The check is incorrect as it checks for NULL while vdd would contain an ERR_PTR, so there's a real issue. However, not all platforms support the CSI-2 receivers, and only omap3-n950.dts and omap3-n9.dts provide the regulators. They thus need to be kept optional. Would you like to provide another patch that fixes the checks in omap3isp_csiphy_acquire() ? > > /* Clocks > * -- Regards, Laurent Pinchart