From nobody Fri Apr 3 10:19:53 2026 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (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 6632E3D6485 for ; Tue, 24 Mar 2026 10:29:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774348156; cv=none; b=jHct6vYAoIDopMPMbzYiWEumHCNdWWFcw98zSYQbCuBY4QaM9W2xUNRwWcJd+coNzekYH+V0LVfUfxaN6ZjiM4/OlXdLtRknOFEUNVmuStjTafQJTk7vgyhqbpvXJ29epNp9HmcPr2UC1AmTscuNM4EbnUVMjbLnIZ+isQYk9VI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774348156; c=relaxed/simple; bh=i5EI1moGymL06UGxUyHFrUJcTR0LqBMbRoOOYGvAgAQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=UKCL+xp6lAhcHdh4JakEJzZZVtMEyKwtJp7e6hdnfmXBYtn08otX0EAvk86zAdQc7RKnW5HKD8uH7YoOCh7e/5Rv+IOzl7+3OX3VmiGfSmqWYwa9sXnqNLmjX+XMkCi8xQAAxJZr7gvIlDsN2ILbUWHX1+aK7XVPjKwLlCuKDj4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=nonF8wNc; arc=none smtp.client-ip=209.85.218.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="nonF8wNc" Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-b886fc047d5so876550966b.3 for ; Tue, 24 Mar 2026 03:29:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1774348151; x=1774952951; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=aRMqYkzH2ATFPczINkjP7Gb8RPcC4sgJ7rhsMNlJdGU=; b=nonF8wNcSzbhAdrGjDSpHWvz90fBdE4A61pfCFXNzNqK8IupaWr9JpfdpNONNI7H70 ked3K6QM+m+7sih8kf1eusyqFEHsd+/EnuHW8udR+GL205/zQMsljxa9Iu2uQtPXRWdo DRqdj3B2LcyVtlsWQ7iuTbN1hiiLP4wMenCMY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774348151; x=1774952951; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=aRMqYkzH2ATFPczINkjP7Gb8RPcC4sgJ7rhsMNlJdGU=; b=G3AVVg3n6kByOHGDSOwxLhVMfWAqZXlECVef41VyZhC58hZeoRZtkftnDDZZa548BU Ge7cEs8Y/wclt1v+aYn6WBgkbwYnl8e4zCQY3rtADRxuY3mEv5CREIztQtX0pS3qHVbT oxXhcTMNCOCcNlw/Sv2liXd8AgAnap+cm+jIE5pyJySrwTr2U4okJSdJiRmu9Hh9kAjS Hq3tNPB4uxzkaHOZxR90bW2RuZRtuO+gsJoYwmjULeAWAd4w9hlvccHTgT5HwJGFTbgF XpsVsmwx6URoeMIB+O8hwBA0JMctw2Sn5wqMTfFSYbyEZchMpzkLaKhUb/8ZdPai1lpB 2Lvw== X-Forwarded-Encrypted: i=1; AJvYcCUioNMt1t3kGtitJtFKP7Rh20PKvc546goVA/Au2EOT33PknvY67Fzk9Bbn8dsAsP+KWGPwpHHUCqxUtOs=@vger.kernel.org X-Gm-Message-State: AOJu0YwG4Hq5WyZd5Lg6E/U4f1byAn4SLDrRiykt+MXtWlajpCQ8iedf yFo2klKaIi5pMQoiC60RoyMnk1LNdX7mmOkjmHF8hz34Xfe5+rY/09or55n/hOs//w== X-Gm-Gg: ATEYQzx4g3AI9kQZnqhIRm+BgjSBFP60KX6H0vyb5ycEK8ImuYeL0k/TwqZF5GUyFic Ctzyr/LRVn3jC9wh83oRt++37b5Mr7eQy8gVKQI4yszWTBbZ8+vHyJ5j3jUzk6ni67sf1+v0LiZ shhhoFAhCuT/UMg2wHoy0KCChYqJKJYr/JleO3sdmus84C+7WFMZLaQBrhghD8l9+c8g4KkIK3L D+It4l0UNcGt/6AVPh0MOvbW6/I6rhoFaEvNXZQDeFlkFJ2yKk4Azdm8j2GcWBO20cXd9eRi5Kl Csu8Nn8Fkn8n09abbFR/9U7PSF5VxviFdPK7gXPkB738HNXXMyBcIjTpE6YfdUuXbfGDh0UDJst y5Qgt1NQwuDy67fgu/wCPqA8bseIL7Mjch6eY70OUb0aDHKPB/2d4IL+dpapU8gqnGgsk1VEqis 1ld0swiF9sgJmxHnqYCJqv/mObnzVeshrEWKk1kx5VEVljFGA6i6okAn+/xdnM/DhA2hBEBsbhA n6kqOZvDpzuiPfLkS8AByJkcujmmvrwjw== X-Received: by 2002:a17:907:60d6:b0:b98:4a7a:d5f8 with SMTP id a640c23a62f3a-b984a7ae58cmr861028866b.46.1774348151375; Tue, 24 Mar 2026 03:29:11 -0700 (PDT) Received: from akuchynski.c.googlers.com.com (218.127.147.34.bc.googleusercontent.com. [34.147.127.218]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b9832f43a65sm613162366b.7.2026.03.24.03.29.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2026 03:29:10 -0700 (PDT) From: Andrei Kuchynski To: Heikki Krogerus , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Andrei Kuchynski , stable@vger.kernel.org, Madhu M Subject: [PATCH v2] usb: typec: Remove alt->adev.dev.class assignment Date: Tue, 24 Mar 2026 10:29:03 +0000 Message-ID: <20260324102903.1416210-1-akuchynski@chromium.org> X-Mailer: git-send-email 2.53.0.983.g0bb29b3bc5-goog Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The typec plug alternate mode is already registered as part of the bus. When both class and bus are set for a device, device_add() attempts to create the "subsystem" symlink in the device's sysfs directory twice, once for the bus and once for the class. This results in a duplicate filename error during registration, causing the alternate mode registration to fail with warnings: cannot create duplicate filename '/devices/pci0000:00/0000:00:1f.0/ PNP0C09:00/GOOG0004:00/cros-ec-dev.1.auto/cros_ec_ucsi.3.auto/typec/ port1/port1-cable/port1-plug0/port1-plug0.0/subsystem' typec port0-plug0: failed to register alternate mode (-17) cros_ec_ucsi.3.auto: failed to registers svid 0x8087 mode 1 Cc: stable@vger.kernel.org Fixes: 67ab45426215 ("usb: typec: Set the bus also for the port and plug al= tmodes") Tested-by: Madhu M Signed-off-by: Andrei Kuchynski Reviewed-by: Benson Leung Reviewed-by: Heikki Krogerus --- Changes in V2: - Marked as a Fix drivers/usb/typec/class.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c index 8314309094719..0977581ad1b6e 100644 --- a/drivers/usb/typec/class.c +++ b/drivers/usb/typec/class.c @@ -686,10 +686,6 @@ typec_register_altmode(struct device *parent, =20 alt->adev.dev.bus =3D &typec_bus; =20 - /* Plug alt modes need a class to generate udev events. */ - if (is_typec_plug(parent)) - alt->adev.dev.class =3D &typec_class; - ret =3D device_register(&alt->adev.dev); if (ret) { dev_err(parent, "failed to register alternate mode (%d)\n", --=20 2.53.0.983.g0bb29b3bc5-goog