Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4398899ioa; Wed, 27 Apr 2022 03:02:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXZppybF/AIQmBgVDfC4Y/pP4YT72Z1gPu37JtOFDSCHlxE2ws0VDQ4n8D6DY4+Br9W4e4 X-Received: by 2002:a63:7d49:0:b0:378:907d:1fc7 with SMTP id m9-20020a637d49000000b00378907d1fc7mr23448839pgn.252.1651053728472; Wed, 27 Apr 2022 03:02:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651053728; cv=none; d=google.com; s=arc-20160816; b=JEOcFBryhZ4i/oY3nvZVHvLESIhTh8f2Qd0i3k0b36+W8LxYITOLBni8aMhn4WIFcC 91urPCewPw/ogSCX6MrLspqy+Y/wfVH9BFD3PtG1c6NarqRaPSDqCPzGt00ydg9/Vnln 1aZv9YlipR3mNhOe0oQiaDqs7mYoQf4rdAyKfud0Kk0WKbMgO+hsXX2mUsJWWEpDUasp +R6fOFUno7XLm1Iqra9Ug8JNCLE3uPs/baMO3HqcM9YYwTFhzwQ5Y1iHrOtpsOQk4l0S Ek06T3GjKnp2BFJj7bSopq8Tbo1IQGqMFZWZtrQ/Bjxs+I8Qc0C1UOSLaChcC5YC1VgI vCag== 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=TZGj8pGmuUeVF+xduKdaKksh4jO5aTh26KXauEV5Qxs=; b=AsM234leTua3xBj7JDO52Iu6bb88XmYwqD7L+PhQKAX6v4Dg0GtuIDdtblaXlqxusn LS0HwavWRVlNCILxyyZ1zXe7eys3KYmPj8Ryy2Kd6mXL5jiAz9n/UvcACm9yalPucKCC H7MNaIu1Thzhk6gF6RTLewmdm/W/qtdIvcRl4nVATFucWgYswFaeY8/IozqJjnfbViXa KKF0BXN0FgfdLffLdg6nw14gIX0jeLgLl/Hwe9W1P0Sx3h5Fi900/cSNJT4qVXT+MYAN Xjualru3Qkk535AHfo1CAT7U+CTQuBhFCKEex3f2/1H3bZtY9CiSw3yxwxISq0awNsIr kKjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xbzbCx2h; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u3-20020a170902bf4300b0015852f2a130si1022732pls.620.2022.04.27.03.02.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 03:02:08 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xbzbCx2h; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 425D62D9553; Wed, 27 Apr 2022 02:28:51 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358854AbiD0HeC (ORCPT + 99 others); Wed, 27 Apr 2022 03:34:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358867AbiD0Hdp (ORCPT ); Wed, 27 Apr 2022 03:33:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAB2C6B0B5; Wed, 27 Apr 2022 00:30:34 -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 3861861B07; Wed, 27 Apr 2022 07:30:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 421C8C385A7; Wed, 27 Apr 2022 07:30:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1651044633; bh=7IUrdMT9kbbx0DsJsKPAR8psLkzAWpMBFfCUfqBAWig=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=xbzbCx2hvF0hCGkEqxhiO5N0HqXdEGddWDPvYd71bPKnrs6HqtmHS0TASeReeiO0j i4aT5usH7V80GDFG0lzHtx5UIgYhS/htq3wRaYnzp+JyQAqZHFOOh8zR1ThgICjmXu HJT3dURy+l7VwWqgQKv1K/cPA0HBFjWtr44P76og= Date: Wed, 27 Apr 2022 09:30:30 +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: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable 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 Wed, Apr 27, 2022 at 09:42:19AM +0300, Heikki Krogerus wrote: > Hi, > > On Tue, Apr 26, 2022 at 02:07:25PM +0200, Greg Kroah-Hartman wrote: > > 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: > > Oops, that should now be "#include ". > > > > + > > > +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? > > Yes. > > > > + 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? :) > > Okay, I'll make it usbpd. How about some more vowels: "struct usb_power_delivery" please. This isn't the 1980's :) > > > + > > > +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. > > They are not raw kobjects, they are all devices now. That header just > needs to be fixed. You have loads of kobject attributes in the .c file. Either I read it wrong, or you are doing something wrong, as that should never be the case for a driver or device. thanks, greg k-h