From 5ccad5a6da8adffb5196a8cd84f4b6c12d22f367 Mon Sep 17 00:00:00 2001 From: Jordan Crouse Date: Mon, 6 Jan 2020 12:03:39 -0700 Subject: [PATCH 1/2] mhi: Fix compile errors module_init() was incorrectly used instead of module_exit(). Fix the macro and the exit function for the correct prototype. Slightly adjust a function callback to match the header prototype and add a missing variable. Fixes: 689af8a2e0a ("mhi: add snapshot for MHI driver stack"). Change-Id: Ic0dedbad55f535efd0d77b9bb3ff0ea1e25d6f3a Signed-off-by: Jordan Crouse Signed-off-by: Hemant Kumar --- drivers/bus/mhi/devices/mhi_netdev.c | 8 ++++---- drivers/bus/mhi/devices/mhi_satellite.c | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/bus/mhi/devices/mhi_netdev.c b/drivers/bus/mhi/devices/mhi_netdev.c index 6a2ba4b67061..bcd5065cce68 100644 --- a/drivers/bus/mhi/devices/mhi_netdev.c +++ b/drivers/bus/mhi/devices/mhi_netdev.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only -/* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.*/ +/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.*/ #include #include @@ -948,7 +948,7 @@ static void mhi_netdev_remove(struct mhi_device *mhi_dev) debugfs_remove_recursive(mhi_netdev->dentry); } -static int mhi_netdev_match(struct device *dev, void *data) +static int mhi_netdev_match(struct device *dev, const void *data) { /* if phandle dt == device dt, we found a match */ return (dev->of_node == data); @@ -1131,13 +1131,13 @@ static int __init mhi_netdev_init(void) } module_init(mhi_netdev_init); -static int __exit mhi_netdev_exit(void) +static void __exit mhi_netdev_exit(void) { debugfs_remove_recursive(dentry); mhi_driver_unregister(&mhi_netdev_driver); } -module_init(mhi_netdev_exit); +module_exit(mhi_netdev_exit); MODULE_DESCRIPTION("MHI NETDEV Network Interface"); MODULE_LICENSE("GPL v2"); diff --git a/drivers/bus/mhi/devices/mhi_satellite.c b/drivers/bus/mhi/devices/mhi_satellite.c index faecf9f3f2d8..f7c6c07c30ab 100644 --- a/drivers/bus/mhi/devices/mhi_satellite.c +++ b/drivers/bus/mhi/devices/mhi_satellite.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only -/* Copyright (c) 2019, The Linux Foundation. All rights reserved.*/ +/* Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.*/ #include #include @@ -1201,6 +1201,7 @@ module_init(mhi_sat_init); static void __exit mhi_sat_exit(void) { struct mhi_sat_subsys *subsys; + int i; unregister_rpmsg_driver(&mhi_sat_rpmsg_driver); From e7378399f9df789541588790421a46cca7b9ff6c Mon Sep 17 00:00:00 2001 From: Jordan Crouse Date: Wed, 8 Jan 2020 14:46:05 -0700 Subject: [PATCH 2/2] mhi: Export more symbols Export mhi_device_configure to avoid the following modpost error: ERROR: "mhi_device_configure" [drivers/bus/mhi/devices/mhi_satellite.ko] undefined. Change-Id: Ic0dedbada3dd6d3cd760727fe7076dbcfccdfc93 Signed-off-by: Jordan Crouse Signed-off-by: Hemant Kumar --- drivers/bus/mhi/core/mhi_init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/bus/mhi/core/mhi_init.c b/drivers/bus/mhi/core/mhi_init.c index 8d5005a38c3f..8e3a5861f4ae 100644 --- a/drivers/bus/mhi/core/mhi_init.c +++ b/drivers/bus/mhi/core/mhi_init.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only -/* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. */ +/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. */ #include #include @@ -946,6 +946,7 @@ int mhi_device_configure(struct mhi_device *mhi_dev, return 0; } +EXPORT_SYMBOL(mhi_device_configure); static int of_parse_ev_cfg(struct mhi_controller *mhi_cntrl, struct device_node *of_node)