Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp815624lqh; Thu, 28 Mar 2024 18:38:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXJ8AH2VsG/izAd9Lv1vPg2A1CmIt5Glsp8pSbCF9T0KsDgRJRTfszhzEN36NcbUTk0J5PyqkkslwPZzy8lNrtKjH7xIf5rQwHF+ZpQAw== X-Google-Smtp-Source: AGHT+IFkxU8Zcnmswk2rYQrRQj/ycsJyfPbEw3PJZ//4glRzOIGw5iGSdJIs/qV1nCZsKrV8ocpE X-Received: by 2002:a17:90a:66c7:b0:29f:ef34:3004 with SMTP id z7-20020a17090a66c700b0029fef343004mr1039734pjl.43.1711676294262; Thu, 28 Mar 2024 18:38:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711676294; cv=pass; d=google.com; s=arc-20160816; b=F2MVt9FB1r2r9spW3S06AQ2Fxd5KkjiYVhvTmjLmqGlhuSe8RZyQaLeonZiFoZJ616 J417ZYCg/490JkqP76uque0k2TYqhCN6UtHe+3ORVPvlsBvb8vShyxaUzttOgS0t/PNr Yhiz1cEQXJWwaQ6T96fTnV39O7usCU80dJZD8kRnooFvm6FodPYIKttZDmQ+3+joZ0hB /Q+M0YUURSXjiwypeMK+YuLJfopca63QOu0bUoabjY59YllnB329kaHoFm0YQvwS3Pmr 3LSTvSadZ9v+pDXXkJgYymJfg8wtPuSvhT/myzkvOtC+6uVpGRU9DZISGeOTriD3cHYS aaRw== 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=F5fxk6qujixTNwK0I8GiZPYH7REpwlCcLwSQEuNO3Yg=; fh=PttFAPW8P3LcltB6LLkSxjfS8s2IDJS2FYcfjDh8oaI=; b=tgoVy7kVnDbwFyWJ7Xrygg3qZtJIk2aXxGUH3P5wtlVnlIGJzn5AKvSwMsirBbkadx qm5LN/HtuzssHcX3XTQcHph2a9z04lvOIEhVt0onEF/xLcQ0xtdiZWFEEmUbqCXsozOb HMExE7qFOoVNSnayzYnQgZz9i6Zgtr8Bba/fl/dpUfehHCAHor6xQObHPbuqZ7+atbM/ 0h0EIaNQ3rqehC7bD+RNJHGydEXnlJlaiyv6xf6sSDo322LvWwkYKSODCcZWnxfTaDuI x0FyZf1/6vX6V2daEOwDSXGVYIk8OLMg3yFjkEWz4vdVL8Maun9vqSU2kvQwzKpKkBqd 4fNg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=elWZyTp4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-123967-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123967-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id k15-20020a17090a39cf00b002a03ae4c1e7si2756635pjf.21.2024.03.28.18.38.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 18:38:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123967-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=elWZyTp4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-123967-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123967-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 8565DB22F1C for ; Fri, 29 Mar 2024 01:37:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D91E4182DA; Fri, 29 Mar 2024 01:37:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="elWZyTp4" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 F0203B647; Fri, 29 Mar 2024 01:37:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711676255; cv=none; b=crWMHPZW/SLLJUZYABRh5k73GKgLx6FR8LDpy+9lISr7F3upVHG1r8N67MvlwiNwkhxAF6HA51FInNo8ugU6nOI4e61Pv+orzfgT7Z2g2XWHnaPVytQ5Y0qJAp8nDInr+TMQJIo3sKextJSEGywdRdZ24hxSQONTWNX0r/yNfvQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711676255; c=relaxed/simple; bh=9nz+rq79FM47XfedCdMTofsLshSMR9RI7+JLZHL2fsQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=s1wlnJ72R4BQiUs/AAGKnBkGEzzjnvTPxQHHP3QX1YoT9OFtU1iaiXJht3tr2Bc3lTWayFfTPLPUD7KESigs6vidBOtMPmb1KAFQ4t99U01Sp/KWDSxxejpQKSvdiTWZx6hSou0GtDi15JDWNXZYfyAAdJMdQ0teJ7hA8Ssg2w0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=elWZyTp4; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0C3AC433C7; Fri, 29 Mar 2024 01:37:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711676254; bh=9nz+rq79FM47XfedCdMTofsLshSMR9RI7+JLZHL2fsQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=elWZyTp4vpKASFETT+6ImZhX4cArtFmT4SgVYcT66iw5UG3zM2j8ZRY2C6iWskFTE N1MHX2jRiHGin7GDzsKQQPYsEYYRd2dul8yjTL98n6i4nDmdWAxSGld1lyUs/c72Rk aI1buygy+Rim0+oBHPyxLOLanFLG6xHd8Whivir+GaTFMxVw4dK/km3ThPRQohIGEF gNi3Vj/q2cbPXR7O3bkFuC4Iahb8YBF8DTUWhULkMv2SDRg1aorF+TBLuzjVkrnrVV N8ATa5eezwfWDVqA7GQFyjTfwAl9yZr2jUeiZjB6uiNAAVqPruy9I1kPcGn8sRAM8T TrC6EWqS9oI8Q== Date: Fri, 29 Mar 2024 09:37:30 +0800 From: Tzung-Bi Shih To: Krzysztof Kozlowski Cc: Pavan Holla , abhishekpandit@chromium.org, bleung@chromium.org, chrome-platform@lists.linux.dev, gregkh@linuxfoundation.org, groeck@chromium.org, heikki.krogerus@linux.intel.com, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH v2 3/3] platform/chrome: cros_ec_ucsi: Implement UCSI PDC driver Message-ID: References: <03e1941b-0c8a-450d-9b83-76260817d303@kernel.org> <20240328023233.2568230-1-pholla@chromium.org> <2357d78f-8879-41ca-b0e1-6593400252c8@kernel.org> 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: On Thu, Mar 28, 2024 at 01:16:36PM +0100, Krzysztof Kozlowski wrote: > On 28/03/2024 10:57, Tzung-Bi Shih wrote: > > By looking other use cases of mfd_add_hotplug_devices(): > > $ grep -R --files-with-matches mfd_add_hotplug_devices drivers/mfd/ > > drivers/mfd/dln2.c > > drivers/mfd/cros_ec_dev.c > > drivers/mfd/viperboard.c > > > > They also have no ID tables and need MODULE_ALIAS(). > > - drivers/gpio/gpio-dln2.c > > - drivers/i2c/busses/i2c-dln2.c > > - drivers/spi/spi-dln2.c > > - drivers/iio/adc/dln2-adc.c > > - drivers/gpio/gpio-viperboard.c > > - drivers/i2c/busses/i2c-viperboard.c > > - drivers/iio/adc/viperboard_adc.c > > So if there is a bug in some driver, you are allowed to add it? :) There > is plenty of poor examples, so what I was suggesting to look for good > examples. I agree that itself might be a tricky task. > > > I'm not sure whether using the path results in: > > - Lack of device ID table. > > - Need MODULE_ALIAS(). > > in the platform device drivers. And perhaps it relies on the fallback match? > > Guys, think for a sec. If you are adding module alias being equivalent > to platform ID table entry, then why you are not using the platform ID > table entry in the first? That's the entire point. > > So to repeat myself: > If you need it, usually it means your device ID table is wrong (e.g. > misses either entries or MODULE_DEVICE_TABLE()). > > MODULE_ALIAS() is not a substitute for incomplete ID table. Thanks. I see. Yet another example in: drivers/mfd/max8997.c and drivers/rtc/rtc-max8997.c. We should be able to use a platform_device_id, MODULE_DEVICE_TABLE(), and `.id_table` for matching. If that works, I think we need to turn most MODULE_ALIAS() use cases in drivers/platform/chrome/ to this way afterward.