Received: by 2002:a05:7208:13c3:b0:82:bbfa:f723 with SMTP id r3csp1129505rbe; Tue, 14 May 2024 12:22:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXYPO+uHby9ukEwv/PECTHVf0R4bo/tE+YrmSECbglYOSXS/sCP63i5+a+9/Ls40PCIcemZfC+cKBeC0gPeGBM2bwpzPo0fne4Umy4GAg== X-Google-Smtp-Source: AGHT+IFqvH+5TBSm0Hh/X14r1TKvc8vZLasjhg7tyEg2sp9s4gj5USuAqBAid8TNRqIjv15p1Dpx X-Received: by 2002:a05:622a:1b17:b0:43b:15e1:1e87 with SMTP id d75a77b69052e-43dfdaab036mr211819071cf.11.1715714520070; Tue, 14 May 2024 12:22:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715714520; cv=pass; d=google.com; s=arc-20160816; b=yQLs74nFmkLfPfdy1TR+4dwGXLqubR2rzVe1LMSMHA8KglWT0vBCR0Touq9DLBLh24 nkfmYFo0MV8rX7HRWVu1fXPBrXkDa11CwA0GcKSKwAI95bpWzDMuCX1qr78/2uGtfglh Kih8BWv9OVIxYfnUMoXDflQUch4fYmQneeSF3NnT94fSso+eSnBRnOuIj3FMka2UPTor mww5SyCXR29wWaFpUiEdAznZStIkkZfYqzPPJ6JUPEtMBhZl253PqB3/iqWil8Ag3Un5 c6QVYfPY2iK2OTWh4kaR0VyUT4aEjsUakLkR3LqCucPs8Q2cuczSAXQyJl0B/j1kQPu0 rpsw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=KRClRvKP4A31/g3DG4NuGH1lJ4Z+9AjDlKp58XVILks=; fh=eHI79qDKREllGSE1YHlMSvqMFLkuPv3B8ADfTu+F5Mw=; b=mdF5Ll5qGCk5IzdlFZ14bjUDiBSqLKIB2epkSX45dFxuvlBmo+M836JW/trx7GBMO+ v3tl+DJu00tO5m9gREnn3QWpI+/GixskpcvxkAYLlKZ8sjBsABFfn0zvWZLqwgv56mgn 5dgns4yAaDIPtQUcyY1XpdqUMCY4lNzD3VRshzB0Ab+Gu8dma/cSeWlWVSz4PVZatPAx 20eJIBMWvBTijIxLMrXRkO7DKlxIdZ4E/43SuKDloZtZUF0bmXox6T3QM6uYcVqF9d3m Q9Hm8ye1BYiWXHolR3J1+Fk/xNTMtJqeTYlQaUa3k1pBb1Ez08SEcgUeFSvH4J0YDNFw HAnw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Nu3q4M+7; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-178812-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178812-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43e2ccbef1bsi12600921cf.608.2024.05.14.12.21.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 12:22:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178812-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Nu3q4M+7; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-178812-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178812-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 2B1711C21D1E for ; Tue, 14 May 2024 14:33:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3C3A717EB81; Tue, 14 May 2024 14:33:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Nu3q4M+7" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9ECDE144D01; Tue, 14 May 2024 14:33:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715697218; cv=none; b=jlpZu+EiwdYZyWisAXSC351dkZ4N6013sMWDqIhhmSfHzMXORiU/V6sFtNV5N5uAhc9bRsvxWxyGdy0D4xpiPUHozgXfm2DDVBcufrhXRrgO04p5PCSsHGvd0q8dT7/LbaK3EhYJP6DPFtoZRu2FBPelTQdvwOICtselsDdpUI0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715697218; c=relaxed/simple; bh=G4GQTtK/kUGLDea0szwRHFugqKscqEYNp4sHqguTr1c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YJmTUZ0TaelKoGmgtOb0nOY2ecT885+Jk0u+6zlcmzhm0y3R4W4bE1WID81JZWv9h1wwt+i8TqIwWuqFjhKshXR2AhERhRkHXjSmjb9tq+Fd8swG/lFgBguLVdD5EYn8E/7WHWH/GM9agT9OrEKsr7EH/0G7nAY7oKpyZHA8n0c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Nu3q4M+7; arc=none smtp.client-ip=198.175.65.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715697217; x=1747233217; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=G4GQTtK/kUGLDea0szwRHFugqKscqEYNp4sHqguTr1c=; b=Nu3q4M+7XPwBd5xfNClBV+r4aCLdSVz8BEjVU5XWagOPjqiDzFGDSYTw kKOCH2u9QuCkMlib+qbgxp9v75oSFOPqIFNkO3oXbYkKz4RL3zaM7HBTi Sr7gFDU5irnv0Q9PqnPTmPhkkkREsmQL+KwBAkBUC5kKI5iQt6nOPrLfX QZ8pfREOurEHKznrmXQzFnvZf2At2cb6SxSI13kjUZIInYgUb+S+46Wx5 pn7wB3YeRuHD2mWt9uU2lNsvdPrJs0BENDguHixVGt+blCPVNnCK3OQLV 25yebOpuraZpBZfy7dlOg0j8tI1QPQrqWR/5P/vsjrhA1sYeT6SRAVMtO A==; X-CSE-ConnectionGUID: G+e0SnHAQgqHXxjAlqkcVQ== X-CSE-MsgGUID: JD/xDz/mTQeXV6ezRsTiOg== X-IronPort-AV: E=McAfee;i="6600,9927,11073"; a="11515953" X-IronPort-AV: E=Sophos;i="6.08,159,1712646000"; d="scan'208";a="11515953" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 May 2024 07:33:36 -0700 X-CSE-ConnectionGUID: x2PAaXdbQRaRz856ZA6TaQ== X-CSE-MsgGUID: nTnKlSLXR3ieGdLNhsNb3w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,159,1712646000"; d="scan'208";a="68163301" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 May 2024 07:33:34 -0700 Received: from kekkonen.localdomain (localhost [127.0.0.1]) by kekkonen.fi.intel.com (Postfix) with SMTP id 628DD11F9DB; Tue, 14 May 2024 17:33:31 +0300 (EEST) Date: Tue, 14 May 2024 14:33:31 +0000 From: Sakari Ailus To: Dan Carpenter Cc: Bingbu Cao , Mauro Carvalho Chehab , Hans de Goede , Andy Shevchenko , Daniel Scally , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH v2] media: ipu-bridge: fix error code in ipu_bridge_init() Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Hi Dan, On Fri, May 10, 2024 at 06:43:31PM +0300, Dan Carpenter wrote: > Return -EINVAL if "bridge->n_sensors == 0". Don't return success. > > Fixes: 881ca25978c6 ("media: ipu3-cio2: rename cio2 bridge to ipu bridge and move out of ipu3") > Signed-off-by: Dan Carpenter > --- > v2: style change > > drivers/media/pci/intel/ipu-bridge.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/pci/intel/ipu-bridge.c b/drivers/media/pci/intel/ipu-bridge.c > index 61750cc98d70..44a9d9c15b05 100644 > --- a/drivers/media/pci/intel/ipu-bridge.c > +++ b/drivers/media/pci/intel/ipu-bridge.c > @@ -839,9 +839,14 @@ int ipu_bridge_init(struct device *dev, > bridge->data_lanes[i] = i + 1; > > ret = ipu_bridge_connect_sensors(bridge); > - if (ret || bridge->n_sensors == 0) > + if (ret) > goto err_unregister_ipu; > > + if (bridge->n_sensors == 0) { > + ret = -EINVAL; > + goto err_unregister_ipu; > + } This would return an error if there are no sensors. Neither IPU3-CIO2 or IPU6 ISYS drivers should be of any functional use without sensors. But the power states of the devices could be affected by this: the drivers should power off these devices but without drivers they maybe left powered on. I haven't made any measurements though. > + > dev_info(dev, "Connected %d cameras\n", bridge->n_sensors); > > fwnode = software_node_fwnode(&bridge->ipu_hid_node); -- Kind regards, Sakari Ailus