diff options
Diffstat (limited to 'drivers/misc/cxl/guest.c')
-rw-r--r-- | drivers/misc/cxl/guest.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/misc/cxl/guest.c b/drivers/misc/cxl/guest.c index b1b8ac5195e7..816113d9d19b 100644 --- a/drivers/misc/cxl/guest.c +++ b/drivers/misc/cxl/guest.c @@ -889,6 +889,7 @@ void cxl_guest_remove_adapter(struct cxl *adapter) cxl_sysfs_adapter_remove(adapter); + cxl_guest_remove_chardev(adapter); device_unregister(&adapter->dev); } @@ -926,6 +927,9 @@ struct cxl *cxl_guest_init_adapter(struct device_node *np, struct platform_devic if ((rc = properties_look_ok(adapter))) goto err1; + if ((rc = cxl_guest_add_chardev(adapter))) + goto err1; + /* * After we call this function we must not free the adapter directly, * even if it returns an error! @@ -941,12 +945,23 @@ struct cxl *cxl_guest_init_adapter(struct device_node *np, struct platform_devic err_put1: device_unregister(&adapter->dev); free = false; + cxl_guest_remove_chardev(adapter); err1: if (free) free_adapter(adapter); return ERR_PTR(rc); } +void cxl_guest_reload_module(struct cxl *adapter) +{ + struct platform_device *pdev; + + pdev = adapter->guest->pdev; + cxl_guest_remove_adapter(adapter); + + cxl_of_probe(pdev); +} + const struct cxl_backend_ops cxl_guest_ops = { .module = THIS_MODULE, .adapter_reset = guest_reset, |