Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3549193ioa; Tue, 26 Apr 2022 05:56:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIdRpCO+tlBekpT5Boe95DYbqhZpHE7ZjaYNm+qPe9L5BGMJ82BRV+Vj1VjrSVrO3OXtBE X-Received: by 2002:a17:907:9485:b0:6da:aa54:a88 with SMTP id dm5-20020a170907948500b006daaa540a88mr21275058ejc.427.1650977761877; Tue, 26 Apr 2022 05:56:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650977761; cv=none; d=google.com; s=arc-20160816; b=LXvInR+iwe6kAUmh1rhiwam1BU8QjaZ+uyCCFTHdTaKzdLx2NFEJM6ATcW5QpCFvSp yVs4mVpQnZoDkMhKlBvytdSnnQRcEX18fJMkm849BpWieHUUZeZnW6gqZSP5PNPH8xZH 9DkYbSHKfbcuUncwTNmvZ8MlI+5/lXj1DqXaQQIhbZ6qmAaJ7zPLgjFij3ws5Q3SK5Wb to6NXu0rUb6rWI7P7kGs2K4MHa3dFfwW/eaWONiHg1u9FN5ZSGBhZ9HCsAfj0+N0ufJa E2pVlFSl4/KFllkI/vt6HCysnDkcu0GxBpFTxVvZYunVgqOjA0/JUxx2k1mwaYtEhyAs AUiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+92njqFxUbyNIH6+cCohSrtyZWekgGNZE1I/tI0eBTY=; b=JC60tL/mECku2t307VFe6T4J2HpqSQJddNXA5lYd3DcX1pxDCTZKT5whIKavJfOUwj SH/Z52H/u2HRGyQHdx/gB1EvixI+foYg7heYV1akNTJn4ub7ON5xaBDQtjEeNOiDU2wA 738oQw8hNrRp/JIQ6quWDIsQjvd+ySDIFvAyhwQJf4yTriqusMmBpVf5r+XBUVtungj4 sIZ/p7HdnIKgGmXa9SzS1s34kcieuM+nGNm6STvJuaMBd/yZr+ZGzjKnDg7BIyCrQ9cb 50pc8s7XVzg9NDAFORvVoXpNFbm+ui4yLxn4Hl0vFPFJ9gX9Xt+wmiPZeH8wtvnYl92V HIFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="wpW1BEj/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p12-20020a170906784c00b006efc0b0d8e8si15050528ejm.752.2022.04.26.05.55.37; Tue, 26 Apr 2022 05:56:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="wpW1BEj/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349747AbiDZMKj (ORCPT + 99 others); Tue, 26 Apr 2022 08:10:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346373AbiDZMKi (ORCPT ); Tue, 26 Apr 2022 08:10:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E3B910FF0B; Tue, 26 Apr 2022 05:07:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B02C36189F; Tue, 26 Apr 2022 12:07:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94633C385A0; Tue, 26 Apr 2022 12:07:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650974849; bh=OxbjqiCYqZGNcYKHfeRboE5u8cCVCIsg9sZ8AG+vy9M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=wpW1BEj/wFo7lQ0z/48FqIScYvS+Kq3U5wnDcFPP/GWqtIoivm/mV1dHxQUrBWNzI jw9KIw7V1d8E/7vbHsq3LkC9pMt+rSBXZzH0G0i0UfK6I9TBLIcpoLcvwzSO6sV1R9 AXJWZw8/2h3TPYFe1X+d7F9zpSo2AljJUY65ySrc= Date: Tue, 26 Apr 2022 14:07:25 +0200 From: Greg Kroah-Hartman To: Heikki Krogerus Cc: Benson Leung , Prashant Malani , Jameson Thies , "Regupathy, Rajaram" , Guenter Roeck , Won Chung , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/3] usb: typec: Separate USB Power Delivery from USB Type-C Message-ID: References: <20220425124946.13064-1-heikki.krogerus@linux.intel.com> <20220425124946.13064-2-heikki.krogerus@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220425124946.13064-2-heikki.krogerus@linux.intel.com> X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 25, 2022 at 03:49:44PM +0300, Heikki Krogerus wrote: > --- /dev/null > +++ b/drivers/usb/typec/pd.h > @@ -0,0 +1,30 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > + > +#ifndef __USB_POWER_DELIVERY__ > +#define __USB_POWER_DELIVERY__ > + > +#include Why kobject.h when: > + > +struct pd_capabilities { > + struct device dev; This is a device? > + struct pd *pd; > + enum typec_role role; > +}; > + > +struct pd { > + struct device dev; > + int id; > + > + u16 revision; /* 0300H = "3.0" */ So BCD? > + u16 version; > +}; > + > +#define to_pd_capabilities(o) container_of(o, struct pd_capabilities, dev) > +#define to_pd(o) container_of(o, struct pd, dev) > + > +struct pd *pd_find(const char *name); "struct pd" is just about the shortest structure name I've seen in the kernel so far. How about using some more letters? :) > + > +int pd_init(void); > +void pd_exit(void); The kobject question above goes to the code as well. You are creating a bunch of raw kobjects still, why? This should all fit into the driver model and kobjects shouldn't be needed. Are you trying to nest too deep in the attributes? If so, kobjects will not work as userspace tools will not realize they are there and are attributes at all. Try running some tests using libudev and see the lack of attributes with this patch, tools are not going to be able to see them at all this way. thanks, greg k-h