device.h (93b14194acaf2c2d80df9c4900a90c6644dcd92b) device.h (c6df6f5322f7004c71216391e1c0b374d853704a)
1/*-
2 * Copyright (c) 2010 Isilon Systems, Inc.
3 * Copyright (c) 2010 iX Systems, Inc.
4 * Copyright (c) 2010 Panasas, Inc.
5 * Copyright (c) 2013-2016 Mellanox Technologies, Ltd.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 451 unchanged lines hidden (view full) ---

460 device_t bsddev;
461
462 sysfs_remove_groups(&dev->kobj, dev->class->dev_groups);
463
464 bsddev = dev->bsddev;
465 dev->bsddev = NULL;
466
467 if (bsddev != NULL && dev->bsddev_attached_here) {
1/*-
2 * Copyright (c) 2010 Isilon Systems, Inc.
3 * Copyright (c) 2010 iX Systems, Inc.
4 * Copyright (c) 2010 Panasas, Inc.
5 * Copyright (c) 2013-2016 Mellanox Technologies, Ltd.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 451 unchanged lines hidden (view full) ---

460 device_t bsddev;
461
462 sysfs_remove_groups(&dev->kobj, dev->class->dev_groups);
463
464 bsddev = dev->bsddev;
465 dev->bsddev = NULL;
466
467 if (bsddev != NULL && dev->bsddev_attached_here) {
468 mtx_lock(&Giant);
468 bus_topo_lock();
469 device_delete_child(device_get_parent(bsddev), bsddev);
469 device_delete_child(device_get_parent(bsddev), bsddev);
470 mtx_unlock(&Giant);
470 bus_topo_unlock();
471 }
472 put_device(dev);
473}
474
475static inline void
476device_del(struct device *dev)
477{
478 device_t bsddev;
479
480 bsddev = dev->bsddev;
481 dev->bsddev = NULL;
482
483 if (bsddev != NULL && dev->bsddev_attached_here) {
471 }
472 put_device(dev);
473}
474
475static inline void
476device_del(struct device *dev)
477{
478 device_t bsddev;
479
480 bsddev = dev->bsddev;
481 dev->bsddev = NULL;
482
483 if (bsddev != NULL && dev->bsddev_attached_here) {
484 mtx_lock(&Giant);
484 bus_topo_lock();
485 device_delete_child(device_get_parent(bsddev), bsddev);
485 device_delete_child(device_get_parent(bsddev), bsddev);
486 mtx_unlock(&Giant);
486 bus_topo_unlock();
487 }
488}
489
490struct device *device_create(struct class *class, struct device *parent,
491 dev_t devt, void *drvdata, const char *fmt, ...);
492
493static inline void
494device_destroy(struct class *class, dev_t devt)

--- 144 unchanged lines hidden ---
487 }
488}
489
490struct device *device_create(struct class *class, struct device *parent,
491 dev_t devt, void *drvdata, const char *fmt, ...);
492
493static inline void
494device_destroy(struct class *class, dev_t devt)

--- 144 unchanged lines hidden ---