diff options
Diffstat (limited to 'drivers/platform/chrome/wilco_ec/core.c')
-rw-r--r-- | drivers/platform/chrome/wilco_ec/core.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/platform/chrome/wilco_ec/core.c b/drivers/platform/chrome/wilco_ec/core.c index 20ecc580d108..af5fd288b63b 100644 --- a/drivers/platform/chrome/wilco_ec/core.c +++ b/drivers/platform/chrome/wilco_ec/core.c @@ -69,11 +69,25 @@ static int wilco_ec_probe(struct platform_device *pdev) cros_ec_lpc_mec_init(ec->io_packet->start, ec->io_packet->start + EC_MAILBOX_DATA_SIZE); + /* + * Register a child device that will be found by the debugfs driver. + * Ignore failure. + */ + ec->debugfs_pdev = platform_device_register_data(dev, + "wilco-ec-debugfs", + PLATFORM_DEVID_AUTO, + NULL, 0); + return 0; } static int wilco_ec_remove(struct platform_device *pdev) { + struct wilco_ec_device *ec = platform_get_drvdata(pdev); + + if (ec->debugfs_pdev) + platform_device_unregister(ec->debugfs_pdev); + /* Teardown cros_ec interface */ cros_ec_lpc_mec_destroy(); |