Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp86938pxk; Wed, 23 Sep 2020 23:38:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzP7lyD2WlY8W/8j5rzFirt0UKJGDmEKvWMiW2100uBkrp5seqrc5aIK2U9FM5kzo6uO65n X-Received: by 2002:a17:907:110f:: with SMTP id qu15mr3235467ejb.359.1600929494744; Wed, 23 Sep 2020 23:38:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600929494; cv=none; d=google.com; s=arc-20160816; b=EKi3U8pb+MbXvSIXc+nvVbIikd87ivvx3KaCV5ADWlNd9slOZ4LXm+V88ygj0D2GRs HAFqGnMp0Xg1fh8Brc0YQ0JJKqCvMZbwsCTlWrPzuP/EPM8nfck3NeebRssAAoZG0Si0 NGpEZGuPUPrDYlh0RMprTQRfXI4dMvd0+ZtOuXA8vwJWla/Qh0H/dUh4YYjZ7TqTFzwD luw9jDMeP8lPC631IsyjFiBPTvTQTkHz2+ySoqM91oI7gyqfwDE25ZqcqGbUOeorSQZe 8gsWmiuFs5Wp2msNseqwRl9Ngir7S2fRy+8VnTEFjwO4512Fd4bpKRd2TDYaRS5F6sPa tuRg== 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=lWTpwoc2bp9cmZ/LahqRL/KhnvL31aN+/rb/oEnHYHw=; b=Wn8OxULlfLblCh+8pYstqasjt2cSym2kWmuR3yWlFBD2VteIWWeQ60J/E6EvRuGl+Y VsZiSeM6hw6Q4OmI7VKCujMrgfGwsQrjRpcm8sXH5UrAPO05ti5agV0l7K45n4k4MvrW HzxXORoFAeF+yGmsqBf7JQJtuKPN4y6n/uwjPa3cR2NLZ98wNrE6U8ZvFVmkgaQhtKl3 TPslLHVMZsmehp2ahWqwSwg5jaXyCDEy8EdpmqnJ5xSMaunB38rKgTZHEnG8YrvImM4b Jb4oPLs3837vlQb0l2mU+WytJSgZGk0SJBFgmoyTcK62Q9uJ01EJDEH5ih79wE2w/YjQ mbGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RqDQn+Pu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n25si1356844ejc.572.2020.09.23.23.37.50; Wed, 23 Sep 2020 23:38:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RqDQn+Pu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727016AbgIXGg0 (ORCPT + 99 others); Thu, 24 Sep 2020 02:36:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:48156 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726846AbgIXGg0 (ORCPT ); Thu, 24 Sep 2020 02:36:26 -0400 Received: from localhost (unknown [84.241.198.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 75E792311A; Thu, 24 Sep 2020 06:36:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600929385; bh=k/MfKAr0I4G8TJNbm1gV8eI6DluYKtODXwraB9Gmu9w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RqDQn+PucuvysvMgPEHFI5GTxoWvKOMTOz19Zk5TzG40nqUB3KlTT0mzRPEXLKV46 bwaJzWy8ZvB+iSqfpcjXjj/EJzcLWxIY3gYrn+9e7RYR8EWd9pwFaS+qpLuXFLihKM eEhqIhPkCGFqdJymm8De0UYbEnXy9xZplotKzuCo= Date: Thu, 24 Sep 2020 08:36:21 +0200 From: Greg Kroah-Hartman To: Matthias Kaehlcke Cc: Rob Herring , Frank Rowand , linux-kernel@vger.kernel.org, Douglas Anderson , Alan Stern , linux-usb@vger.kernel.org, Bastien Nocera , Krzysztof Kozlowski , devicetree@vger.kernel.org, Ravi Chandra Sadineni , Peter Chen , Stephen Boyd , "Alexander A. Klimov" , Masahiro Yamada Subject: Re: [PATCH v2 2/2] USB: misc: Add onboard_usb_hub driver Message-ID: <20200924063621.GA593410@kroah.com> References: <20200917114600.v2.1.I248292623d3d0f6a4f0c5bc58478ca3c0062b49a@changeid> <20200917114600.v2.2.I7c9a1f1d6ced41dd8310e8a03da666a32364e790@changeid> <20200920141720.GD2915460@kroah.com> <20200922011837.GE21107@google.com> <20200923222545.GB2105328@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200923222545.GB2105328@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 23, 2020 at 03:25:45PM -0700, Matthias Kaehlcke wrote: > On Mon, Sep 21, 2020 at 06:18:37PM -0700, Matthias Kaehlcke wrote: > > On Sun, Sep 20, 2020 at 04:17:20PM +0200, Greg Kroah-Hartman wrote: > > > On Thu, Sep 17, 2020 at 11:46:22AM -0700, Matthias Kaehlcke wrote: > > > > > > > > ... > > > > > > > > +static int __init onboard_hub_init(void) > > > > +{ > > > > + int rc; > > > > + > > > > + rc = platform_driver_register(&onboard_hub_driver); > > > > + if (rc) > > > > + return rc; > > > > + > > > > + return usb_register_device_driver(&onboard_hub_usbdev_driver, THIS_MODULE); > > > > > > No unwinding of the platform driver register if this fails? > > > > Right, will add unwinding. > > > > > And THIS_MODULE should not be needed, did we get the api wrong here? > > > > It seems you suggest to use usb_register() instead, SGTM > > Actually usb_register() is for registering a struct usb_driver, however > this is a struct usb_device_driver, there doesn't seem to be a > registration function/macro that doesn't require THIS_MODULE. Please > provide a pointer if I'm wrong. You are correct, I was just making a meta-comment that we got this api wrong when adding it to the kernel and need to fix it up so that you do not have to manually pass in the module owner. i.e. make it much like usb_register() does. thanks, greg k-h