Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp588580lqo; Fri, 10 May 2024 08:43:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWVgJ2PmvRbkoQg6KFim8Uy9SxK8x6iiXgy1k2lGWlblnbkUQfW69bikWTJ3ZreiMFMxLPZ4P1M4GWziLO8UHWxTXe3r7OXoINBwWvAeQ== X-Google-Smtp-Source: AGHT+IEkr4ok4tc4+BZaRhvkebkYCLpy6GZ6tmGP+jMrW6zL287ZtgwMfUq6nvIMhlfWCFZ8S51a X-Received: by 2002:a05:6122:2018:b0:4d3:3846:73bb with SMTP id 71dfb90a1353d-4df882c5cd8mr3552022e0c.7.1715355836315; Fri, 10 May 2024 08:43:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715355836; cv=pass; d=google.com; s=arc-20160816; b=hmRO+FS9HkS1BUtzX1L+vpSx36ZwyBO14i90nCI+DjgeIXYyuV5BF+t9f4h0/EJD43 JWa2OTwlIyaVBE3/XE2xst294mI3PTNADyWGFXxFjdr6XCsMDxOKsEJyd2buMk1eOPql hMr/jYgobPeAxQwXgLWEuZTF18wBy5W4qEJ8cV9A84EzVtyvEuis7Sf5qI+IhfSIrVKR VJRx7stDcffx8m5/0VtwWD4RQ/gPaTCt82CAIkX0RMNJtDYZa4z5+Q5XZsef/yXsWHJL A4YFwJJrYUYInX6wYcbLIGLbykc1onEOaPrZm//+D36FPHC0vL6MnHedeLpzAEwyRPIY mfcQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=8I2JjkdieyXRbDrING1zf6naqG91T7vTKCJRxlvQiF8=; fh=EQbnq/HEdCMU/Ij2i8Y82AWir8OoPUdE9SasLKLhfeo=; b=DtXo4X/lYidhR2MpmbgHE8o3IZlJjDI4OBU3WiLVY6tC5QgjfYyTpU6iEd0SQheoNL FarY5ci6xLxiAQL1+NvJtBBqtschnC4JfzbB3U4OOBn9fT65yoRSI6cll2BoWTqUMmEB xxLhm7+nKqU4I9LYN0hl5XX3Olx8iNCJAPvct9afktxcAkMH7CRAE+LVaQcQ8kBui/Vb cTSQEyFzJ1faslVGCWJDMGE69idgafyC+5Prg3oBi3F5E0CWGe+uPQ843Y/LiB94Fkow WCjdU/ocdjGDkb8afYUmXun5NX//i5WsZ83Pe/QyH+zJ3sYqsf29sdnZZCa8FDqvOHvD ljqQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lJAnfTAW; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-175974-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175974-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6a15f2b71d1si38463026d6.368.2024.05.10.08.43.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 08:43:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-175974-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=@linaro.org header.s=google header.b=lJAnfTAW; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-175974-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175974-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 0D80F1C2109D for ; Fri, 10 May 2024 15:43:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 83EF6172780; Fri, 10 May 2024 15:43:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="lJAnfTAW" Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 20275172763 for ; Fri, 10 May 2024 15:43:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715355818; cv=none; b=FmOUs6lLygt0a2dgpzYCl8Mu5KAluofbMfGLGIhh+yExt5nF/E4UogPkBEuy2qyvuCjAAOn3spqjL1hxH41gibCU9+Qs1SkhBDhzV8TIuOKpQIUFlJY637rp+uOljeKLpgZEaKflXrv9IYpY/ee4uLxyr1eiZH/TuO+3AmKwPxA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715355818; c=relaxed/simple; bh=G+xH4AF7qc1ighXdU78nJKRNV28XMKcLeMrlk66frcg=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=HtUf9S9P8jOYVA4w5XWUxB80zhLG+ZbPgvhxhBa20DzUCBH+9BG84ar5vM9W/wjmvMMG0NhSMsxJdB1Noc1RGZvX0+b2a4SPAkcDNr42EuHBx1CBJi7Ipbe6BHYMmfkQzjeDJ2r2nfDXkyV4GckRYnTUAyoWcmdsrUh7l+B3HTQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=lJAnfTAW; arc=none smtp.client-ip=209.85.218.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-a59a352bbd9so371687866b.1 for ; Fri, 10 May 2024 08:43:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715355815; x=1715960615; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=8I2JjkdieyXRbDrING1zf6naqG91T7vTKCJRxlvQiF8=; b=lJAnfTAWr0eB1d6zLYyals0T0hmKJdgXD2083m4Qck2tgYJuM+9RWaWPHbXmTB2Jyd PpoSuQvD6rZJ1+mnscgQe92EaZNrN3xdlZJ3TtZSaOgrBVW+g0xQgJdAhenaHS/0RuzD ZuTgBt+1ah6VdyCIttyrupILsEd5Wopg85SthMfUgFwXGLAZeirgWMeRXq7RVcQnh+vF 21mHwxTvPxsfo5/wXTAxlnhoXw17yKD9PE+IqOC+DVy0P/dWrp1AahAWCkb1z4LeD3ml Sp7f70efSwRX42iKufIKrjsmEa7JWu0O0mehT5BuM5Qu3i51aV8b/AEM9jWPlsQXqpVC yOeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715355815; x=1715960615; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8I2JjkdieyXRbDrING1zf6naqG91T7vTKCJRxlvQiF8=; b=jUY8CoAkqsWO1WKiEUbU5tEkM7YOaLkkDtaNkE8uZzCzfbH4C14qILv91m2vEnwJJH 674aKyNnjaxlESV591mddpOHT5CbkAwIGbbljfEhE+MawwlcSb90F5XnJ7Fu9FZg0GtJ YmZIOlDHI36D1jgVBG5VX0TtX/Q9/Kz26mDbnrLDF6t9vXuBpZWtf+fPbkg0FR8dz1DS JVEJO8gCD2t3/OfTmoJad5bmgEkC2YFepNvj+Q7FrkYEvbjSHWf9a8wWPXBTlUa0wFMz FrAAPw9DYLXXVn875zJnd+kCQDvVj6t6ry9tYQeXA58j2lR49cph9Px4STL3ylR2tyrc 5a3A== X-Forwarded-Encrypted: i=1; AJvYcCW6WxxnjeKtPpiUXHdexSPBRAKYL8vhCh7rhwCV2/rWuhtnve9KSxriVN8fv0nOrmbSbR9G5SKm+RAFtg5dIcpv/4JDLokSXKSN0mdW X-Gm-Message-State: AOJu0YzHCBYi3M/goRf32bZVUMCUhPRfCOLk/SAv+MogWyQ8pR3fpynq sRaqRpGkKa0muGzdDh4PcOQDRNwZ9iB3/F6WesWfLSEDmyBiKwI5TmJVhZdoIto= X-Received: by 2002:a17:906:b7c4:b0:a59:bb24:a61 with SMTP id a640c23a62f3a-a5a2d292a23mr261622066b.30.1715355815485; Fri, 10 May 2024 08:43:35 -0700 (PDT) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a1781d27bsm194279066b.21.2024.05.10.08.43.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 08:43:35 -0700 (PDT) Date: Fri, 10 May 2024 18:43:31 +0300 From: Dan Carpenter To: Bingbu Cao Cc: Mauro Carvalho Chehab , Sakari Ailus , Hans de Goede , Andy Shevchenko , Daniel Scally , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH v2] media: ipu-bridge: fix error code in ipu_bridge_init() Message-ID: 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 X-Mailer: git-send-email haha only kidding 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; + } + dev_info(dev, "Connected %d cameras\n", bridge->n_sensors); fwnode = software_node_fwnode(&bridge->ipu_hid_node); -- 2.43.0