lkml.org 
[lkml]   [2023]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] nvdimm: nvdimm_bus_register: Avoid adding device to the unregistered bus
lizhijian@fujitsu.com wrote:
[..]
> > Now I do think it would be a good idea to fail device_add() if the bus
> > is not registered,
>
> BTW, below line 369: device_add() didn't fail in practical.
>

I think that's ok because the device gets added, but never probed due to
this part of that commit I referenced:

@@ -503,20 +517,21 @@ int bus_add_device(struct device *dev)
*/
void bus_probe_device(struct device *dev)
{
- struct bus_type *bus = dev->bus;
+ struct subsys_private *sp = bus_to_subsys(dev->bus);
struct subsys_interface *sif;

- if (!bus)
+ if (!sp)
return;


...so it does what you want which is disable the libnvdimm subsystem
from binding to any devices without crashing.

\
 
 \ /
  Last update: 2023-03-27 01:10    [W:0.038 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site