Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp483949lqb; Wed, 17 Apr 2024 02:12:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXrH8Nh/1T7987PASJRGBOJPL3V4iOs4KfeqLslzs5CRlMH2OnHJymNcnEmk7WOgz+MRBmiGuzIcJKSfIajA+B1d/5HMjOq8tu+usiF2Q== X-Google-Smtp-Source: AGHT+IFTwLs9XrnT7UOlzCcaP/FpdUFrj9sKXEQpO9Bh8rOb89IkuGEcg4zxHTsgcZqEyTg8ukjE X-Received: by 2002:a05:6358:9615:b0:183:a0ac:b5ab with SMTP id a21-20020a056358961500b00183a0acb5abmr16614848rwb.19.1713345144326; Wed, 17 Apr 2024 02:12:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713345144; cv=pass; d=google.com; s=arc-20160816; b=dHvfMWQ69hs3ZWfHl29tVKhmmtTlWlJbhGxrNecoYRI2qgJ2FJkSaVr1HO5cON/6Te 8crN4ddcJeifQKhmFQ4oSE8r8EZlcz2o5IO5evuJFPZyRUmc/k2h8ZwYwcX6iq+0Z/V9 cKO2ogAaUgYNJPCU7t0kti99bs/NCTixYAmIgIVFc1sMlsrtmtMeancoZgWk85p2xiBT IkXzta39fwNg7eLERMW99r0Tcp/I5Mt+TewM4gCOV2u18W/YvsjmZ5o7YFav+eiLxPAt cxKSzC0OquQrcGaMuLAk+YQZeVzoXeWY4fBemLorqkZdTXimOinwqwaBFTH96oEFylHn GLiw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=dkim-signature:cc:to:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from; bh=f5pWlvugPptcvo9q7M8W7i3/NU50UzEPnCDDkAgQDLo=; fh=DHc7Fs39yABh+3Oo4S95Ziqi0sjK8MxiVhLysAFVfqg=; b=PsbkErDieCTvwKNLuG47Uys7A0r+sfnhPV5WY1FYVNRZw/ij/b+Bt8Wgqjo0xYn1Js 769D7o2lWOGPoofCfVG4bUN3iFEjSFBKuK8Wta1TJJxG5LCrnCCgsjFZuzwRLMFPKraV vtteaTFudZzbyn+wSraBX+87JD5DzcLaiXzpN86cfc0MT/V2viUKYylSyHKeoPdKsd+m 5m8gFkEahGtnqLnAldDl3/+LeBypUqZCXsZzag+fyeUiP6IkP3QWDdaRGUWUX+mdOOpb /czRQucFcLGrEk3w5jr0w6/bqJiRoaxeNYdisPrqFKSx6ohxZlEyjxpVkT7uBCVbu7Rp i4Lg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@herrie.org header.s=transip-a header.b=MQZ3votM; arc=pass (i=1 spf=pass spfdomain=herrie.org dkim=pass dkdomain=herrie.org); spf=pass (google.com: domain of linux-kernel+bounces-148208-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148208-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c7-20020a05622a024700b004368ee4f7d4si12458649qtx.151.2024.04.17.02.12.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 02:12:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-148208-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@herrie.org header.s=transip-a header.b=MQZ3votM; arc=pass (i=1 spf=pass spfdomain=herrie.org dkim=pass dkdomain=herrie.org); spf=pass (google.com: domain of linux-kernel+bounces-148208-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148208-linux.lists.archive=gmail.com@vger.kernel.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 116171C2113C for ; Wed, 17 Apr 2024 09:12:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B3E1012BF1A; Wed, 17 Apr 2024 09:12:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=herrie.org header.i=@herrie.org header.b="MQZ3votM" Received: from outbound8.mail.transip.nl (outbound8.mail.transip.nl [136.144.136.8]) (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 0477B5810F for ; Wed, 17 Apr 2024 09:12:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=136.144.136.8 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713345138; cv=none; b=JPihyy+m2vFYkaxx3zVKdo0nFANfpeIBYQTeep6EFfMjXHaDBbr4/+AE8dO43GrzRjvuADOVvR8Z4W6Jrpy9wHBdIwT3dFUb6wgsiRFDsvjqSZq85JcuR9iKth8uJb4fAFJgrlrUxg8nU0ZGv0i2ARIiE/zZ5ouZueccjivcmIE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713345138; c=relaxed/simple; bh=VRiVEbHM2P9YEekiNpe1oZU5DPqCzezeEvX2ypwiNS0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=fqPKCr21MTrh/aUOW2H6JFCRPMz/9yQPWoStaE1o9LrEhAEi/DmG60mR7wGFXkDZ813oJ2tS+uFz3hYRZMI+cp6osHH9Hw0sN+kMZ7JLBbM05wYbNgM1W5sHbFg+qJ4KOrqTjNqMog+8i2X4N5I/WboFuXC0deFe0JIf8L7NgcQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=herrie.org; spf=pass smtp.mailfrom=herrie.org; dkim=pass (2048-bit key) header.d=herrie.org header.i=@herrie.org header.b=MQZ3votM; arc=none smtp.client-ip=136.144.136.8 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=herrie.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=herrie.org Received: from submission13.mail.transip.nl (unknown [10.103.8.164]) by outbound8.mail.transip.nl (Postfix) with ESMTP id 4VKFXp3KBLzY76Kw; Wed, 17 Apr 2024 11:12:10 +0200 (CEST) Received: from [127.0.1.1] (110-31-146-85.ftth.glasoperator.nl [85.146.31.110]) by submission13.mail.transip.nl (Postfix) with ESMTPA id 4VKFXn1kPlz1y46; Wed, 17 Apr 2024 11:12:09 +0200 (CEST) From: Herman van Hazendonk Date: Wed, 17 Apr 2024 11:12:09 +0200 Subject: [PATCH] component: Support masters with no subcomponents 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="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240417-component-dummy-v1-1-b0854665c760@herrie.org> X-B4-Tracking: v=1; b=H4sIAGiSH2YC/x3MQQqAIBBA0avErBPKDKmrRItBp5qFGlpRhHdPW r7F/y8kikwJxuqFSBcnDr6grSswG/qVBNtikI1UjWq1MMHtwZM/hD2dewQOiNSj0bJTUKo90sL 3f5zmnD81B83AYQAAAA== To: Greg Kroah-Hartman , "Rafael J. Wysocki" Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Linus Walleij , Herman van Hazendonk X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1713345129; l=2091; i=github.com@herrie.org; s=20240417; h=from:subject:message-id; bh=VRiVEbHM2P9YEekiNpe1oZU5DPqCzezeEvX2ypwiNS0=; b=c0KNXUbpABkwqE0nzndSWHDlCfnS599Du8qBSroBZgyHgD5lKAgPTvRx8q4ogEzGkM3ZIiUSq KFQdW5ZX/nPBRlNxe8QmBwUxNMKVZDPHbizPXuM6BLIC9HJrS32c8Kw X-Developer-Key: i=github.com@herrie.org; a=ed25519; pk=YYxdq8fb5O9vhkW3n2dCH044FPZZO5718v/du7fRhFw= X-Scanned-By: ClueGetter at submission13.mail.transip.nl DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=transip-a; d=herrie.org; t=1713345129; h=from:subject:to:cc:date: mime-version:content-type; bh=f5pWlvugPptcvo9q7M8W7i3/NU50UzEPnCDDkAgQDLo=; b=MQZ3votMUxsBhd2fMjScAnwdaPULK37fmk1IWCWKXNwn24giQWMUhdYqK3TK+rpaujAy5K cEBrltilbvKQ9V+550UVmCx66CJTjtvt3PltyNZrP+wNSzFBhEkCZSzN3g+tWpPVS4bRR2 y5poJHKPSDDwwN4AFwuLMlCv0VzIerC+Ogj2aqrpWD4C4s+jDu0dx9/i6IDew+mVGmkcG5 64rDSS6Wl4IlxEzigjkIgL0tItAtCH4GienhAsVPYtkrh3qmGtWQ3o8XhL+fWlvxDMgynv W1Bct5bba27OkGj4eJrIeYwV3L8GO1eY+HF0gX/nB4rv6S2aCGTvi0zHOo6iRA== X-Report-Abuse-To: abuse@transip.nl This happens in the MSM DRM driver when it is used without any subcomponents, which is a special corner case. If the MDP4 is used with nothing but the LVDS display, we get this problem that no components are found since the LVDS is part of the MDP4 itself. We cannot use a NULL match, so create a dummy match with no components for this case so the driver will still probe nicely without adding a secondary complicated probe() path to the MSM DRM driver. Signed-off-by: Linus Walleij Signed-off-by: Herman van Hazendonk --- This happens in the MSM DRM driver when it is used without any subcomponents, which is a special corner case. If the MDP4 is used with nothing but the LVDS display, we get this problem that no components are found since the LVDS is part of the MDP4 itself. We cannot use a NULL match, so create a dummy match with no components for this case so the driver will still probe nicely without adding a secondary complicated probe() path to the MSM DRM driver. --- drivers/base/component.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/base/component.c b/drivers/base/component.c index 741497324d78..bb79e7a77bb0 100644 --- a/drivers/base/component.c +++ b/drivers/base/component.c @@ -497,6 +497,10 @@ static void free_aggregate_device(struct aggregate_device *adev) kfree(adev); } +static struct component_match dummy_match = { + .num = 0, +}; + /** * component_master_add_with_match - register an aggregate driver * @parent: parent device of the aggregate driver @@ -516,6 +520,9 @@ int component_master_add_with_match(struct device *parent, struct aggregate_device *adev; int ret; + if (!match) + match = &dummy_match; + /* Reallocate the match array for its true size */ ret = component_match_realloc(match, match->num); if (ret) --- base-commit: 96fca68c4fbf77a8185eb10f7557e23352732ea2 change-id: 20240417-component-dummy-a9aae5ac7234 Best regards, -- Herman van Hazendonk