[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200618081850.GB1043700@kroah.com>
Date: Thu, 18 Jun 2020 10:18:50 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Vladimir Stankovic <vladimir.stankovic@...playlink.com>
Cc: linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org,
mausb-host-devel@...playlink.com
Subject: Re: [External] Re: [PATCH v6 3/8] usb: mausb_host: HCD initialization
On Thu, Jun 11, 2020 at 08:18:34PM +0200, Vladimir Stankovic wrote:
> On 15.5.20. 15:07, Greg KH wrote:
> > On Fri, May 15, 2020 at 02:34:57PM +0200, Vladimir Stankovic wrote:
> >> --- /dev/null
> >> +++ b/drivers/usb/host/mausb/hcd.c
> >> @@ -0,0 +1,120 @@
> >> +// SPDX-License-Identifier: GPL-2.0
> >> +/*
> >> + * Copyright (c) 2019 - 2020 DisplayLink (UK) Ltd.
> >> + */
> >> +#include "hcd.h"
> >> +
> >> +#include "utils.h"
> >> +
> >> +static int mausb_bus_match(struct device *dev, struct device_driver *drv);
> >> +
> >> +static const struct file_operations mausb_fops;
> >> +
> >> +static unsigned int major;
> >> +static unsigned int minor = 1;
> >> +static dev_t devt;
> >> +static struct device *device;
> >> +
> >> +struct mausb_hcd *mhcd;
> >> +static struct class *mausb_class;
> >> +static struct bus_type mausb_bus_type = {
> >> + .name = DEVICE_NAME,
> >> + .match = mausb_bus_match,
> >> +};
> >
> > A static bus type??? For a single driver?
> >
> >> +
> >> +static struct device_driver mausb_driver = {
> >> + .name = DEVICE_NAME,
> >> + .bus = &mausb_bus_type,
> >> + .owner = THIS_MODULE,
> >> +};
> >
> > Wait, what??? A static "raw" struct device_driver? Why???
> This was our initial driver setup that was "inherited" from some
> in-tree drivers. We are currently revising driver setup. In general,
> device driver will not work properly w/o bus being setup and the
> only way to avoid explicit bus and simplify driver setup is to use
> platform driver; however, we are not aware of any explicit dependency
> on the platform, so not sure whether it's acceptable to switch to
> platform device driver setup.
platform devices/drivers are to be used ONLY if your really have a
platform device (i.e. something connected to the system only through
device-tree or hard-coded memory locations.) Do not use this for
virtual devices or anything else that is on a "real" bus.
thanks,
greg k-h
Powered by blists - more mailing lists