diff options
Diffstat (limited to 'drivers/staging/tidspbridge/pmgr/dev.c')
-rw-r--r-- | drivers/staging/tidspbridge/pmgr/dev.c | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/drivers/staging/tidspbridge/pmgr/dev.c b/drivers/staging/tidspbridge/pmgr/dev.c index 4ddf03d3b1a..7893f9a0cf0 100644 --- a/drivers/staging/tidspbridge/pmgr/dev.c +++ b/drivers/staging/tidspbridge/pmgr/dev.c | |||
@@ -85,6 +85,11 @@ struct dev_object { | |||
85 | struct node_mgr *hnode_mgr; | 85 | struct node_mgr *hnode_mgr; |
86 | }; | 86 | }; |
87 | 87 | ||
88 | struct drv_ext { | ||
89 | struct list_head link; | ||
90 | char sz_string[MAXREGPATHLENGTH]; | ||
91 | }; | ||
92 | |||
88 | /* ----------------------------------- Globals */ | 93 | /* ----------------------------------- Globals */ |
89 | static u32 refs; /* Module reference count */ | 94 | static u32 refs; /* Module reference count */ |
90 | 95 | ||
@@ -812,18 +817,31 @@ int dev_remove_device(struct cfg_devnode *dev_node_obj) | |||
812 | { | 817 | { |
813 | struct dev_object *hdev_obj; /* handle to device object */ | 818 | struct dev_object *hdev_obj; /* handle to device object */ |
814 | int status = 0; | 819 | int status = 0; |
815 | struct dev_object *dev_obj; | 820 | struct drv_data *drv_datap = dev_get_drvdata(bridge); |
821 | |||
822 | if (!drv_datap) | ||
823 | status = -ENODATA; | ||
824 | |||
825 | if (!dev_node_obj) | ||
826 | status = -EFAULT; | ||
816 | 827 | ||
817 | /* Retrieve the device object handle originaly stored with | 828 | /* Retrieve the device object handle originaly stored with |
818 | * the dev_node: */ | 829 | * the dev_node: */ |
819 | status = cfg_get_dev_object(dev_node_obj, (u32 *) &hdev_obj); | ||
820 | if (!status) { | 830 | if (!status) { |
821 | /* Remove the Processor List */ | 831 | /* check the device string and then store dev object */ |
822 | dev_obj = (struct dev_object *)hdev_obj; | 832 | if (!strcmp((char *)((struct drv_ext *)dev_node_obj)->sz_string, |
823 | /* Destroy the device object. */ | 833 | "TIOMAP1510")) { |
824 | status = dev_destroy_device(hdev_obj); | 834 | hdev_obj = drv_datap->dev_object; |
835 | /* Destroy the device object. */ | ||
836 | status = dev_destroy_device(hdev_obj); | ||
837 | } else { | ||
838 | status = -EPERM; | ||
839 | } | ||
825 | } | 840 | } |
826 | 841 | ||
842 | if (status) | ||
843 | pr_err("%s: Failed, status 0x%x\n", __func__, status); | ||
844 | |||
827 | return status; | 845 | return status; |
828 | } | 846 | } |
829 | 847 | ||