bus.c (36edb1407c3c042240b5dbc2530d6e7119535baa) | bus.c (f320ff0387a8a2d3123c4f7d6d61eecc740d0466) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (c) 2012-2019, Intel Corporation. All rights reserved. 4 * Intel Management Engine Interface (Intel MEI) Linux driver 5 */ 6 7#include <linux/module.h> 8#include <linux/device.h> --- 866 unchanged lines hidden (view full) --- 875 * 876 * @dev: device 877 * 878 * Return: 0 on success; < 0 otherwise 879 */ 880static int mei_cl_device_remove(struct device *dev) 881{ 882 struct mei_cl_device *cldev = to_mei_cl_device(dev); | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (c) 2012-2019, Intel Corporation. All rights reserved. 4 * Intel Management Engine Interface (Intel MEI) Linux driver 5 */ 6 7#include <linux/module.h> 8#include <linux/device.h> --- 866 unchanged lines hidden (view full) --- 875 * 876 * @dev: device 877 * 878 * Return: 0 on success; < 0 otherwise 879 */ 880static int mei_cl_device_remove(struct device *dev) 881{ 882 struct mei_cl_device *cldev = to_mei_cl_device(dev); |
883 struct mei_cl_driver *cldrv; | 883 struct mei_cl_driver *cldrv = to_mei_cl_driver(dev->driver); |
884 int ret = 0; 885 | 884 int ret = 0; 885 |
886 if (!cldev || !dev->driver) 887 return 0; 888 889 cldrv = to_mei_cl_driver(dev->driver); | |
890 if (cldrv->remove) 891 ret = cldrv->remove(cldev); 892 893 mei_cldev_unregister_callbacks(cldev); 894 895 mei_cl_bus_module_put(cldev); 896 module_put(THIS_MODULE); 897 --- 439 unchanged lines hidden --- | 886 if (cldrv->remove) 887 ret = cldrv->remove(cldev); 888 889 mei_cldev_unregister_callbacks(cldev); 890 891 mei_cl_bus_module_put(cldev); 892 module_put(THIS_MODULE); 893 --- 439 unchanged lines hidden --- |