Re: [PATCH 14/14] nubus: Add support for the driver model

Finn Thain
2017-11-12T03:52:16Z

On Sat, 11 Nov 2017, Greg Kroah-Hartman wrote:

> On Sat, Nov 11, 2017 at 09:45:53AM +0100, Greg Kroah-Hartman wrote:
> >
> > I can't take patches without any changelog text at all, that's not
> > good engineering, sorry :(
> >

I forgot to write it, sorry. I was going to explain the decision to leave
the bus matching up to the driver.

> > Please fix up and resend and I will be glad to review.
>
> Also, please test device removal, I don't think you did that :(
>

The modprobe, rmmod, modprobe sequence was tested. But I think that isn't
what you meant.

Are you saying there is a missing NULL check? That is,

static int nubus_device_remove(struct device *dev)
{
struct nubus_driver *ndrv = to_nubus_driver(dev->driver);
int err = -ENODEV;

- if (ndrv->remove)
+ if (dev->driver && ndrv->remove)
err = ndrv->remove(to_nubus_board(dev));
return err;
}

Anyway, I will revise the patch and test the unbind operation on a device
not already bound.

Thanks for your feedback.

--