aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAjay Singh <ajay.kathat@microchip.com>2019-02-07 11:29:07 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-02-07 13:34:45 +0100
commitd4d30e466a2738b955c66bcce13774a2f1ec28aa (patch)
tree4813da9e363e345ab839ad2b1270895dc0bebe7d
parentstaging: wilc1000: move macro and function prototype from wilc_wlan_if.h file (diff)
downloadlinux-dev-d4d30e466a2738b955c66bcce13774a2f1ec28aa.tar.xz
linux-dev-d4d30e466a2738b955c66bcce13774a2f1ec28aa.zip
staging: wilc1000: avoid function forward declaration in wilc_sdio.c file
Cleanup patch to avoid function forward declaration by reordering the function. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/wilc1000/wilc_sdio.c91
1 files changed, 43 insertions, 48 deletions
diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c
index e2f739fef21c..a62eabe57630 100644
--- a/drivers/staging/wilc1000/wilc_sdio.c
+++ b/drivers/staging/wilc1000/wilc_sdio.c
@@ -51,10 +51,6 @@ struct sdio_cmd53 {
static const struct wilc_hif_func wilc_hif_sdio;
-static int sdio_write_reg(struct wilc *wilc, u32 addr, u32 data);
-static int sdio_read_reg(struct wilc *wilc, u32 addr, u32 *data);
-static int sdio_init(struct wilc *wilc, bool resume);
-
static void wilc_sdio_interrupt(struct sdio_func *func)
{
sdio_release_host(func);
@@ -215,50 +211,6 @@ static int wilc_sdio_suspend(struct device *dev)
return 0;
}
-static int wilc_sdio_resume(struct device *dev)
-{
- struct sdio_func *func = dev_to_sdio_func(dev);
- struct wilc *wilc = sdio_get_drvdata(func);
-
- dev_info(dev, "sdio resume\n");
- sdio_release_host(func);
- chip_wakeup(wilc);
- sdio_init(wilc, true);
-
- if (wilc->suspend_event)
- host_wakeup_notify(wilc);
-
- chip_allow_sleep(wilc);
-
- return 0;
-}
-
-static const struct of_device_id wilc_of_match[] = {
- { .compatible = "microchip,wilc1000-sdio", },
- { /* sentinel */ }
-};
-MODULE_DEVICE_TABLE(of, wilc_of_match);
-
-static const struct dev_pm_ops wilc_sdio_pm_ops = {
- .suspend = wilc_sdio_suspend,
- .resume = wilc_sdio_resume,
-};
-
-static struct sdio_driver wilc_sdio_driver = {
- .name = SDIO_MODALIAS,
- .id_table = wilc_sdio_ids,
- .probe = linux_sdio_probe,
- .remove = linux_sdio_remove,
- .drv = {
- .pm = &wilc_sdio_pm_ops,
- .of_match_table = wilc_of_match,
- }
-};
-module_driver(wilc_sdio_driver,
- sdio_register_driver,
- sdio_unregister_driver);
-MODULE_LICENSE("GPL");
-
static int wilc_sdio_enable_interrupt(struct wilc *dev)
{
struct sdio_func *func = container_of(dev->dev, struct sdio_func, dev);
@@ -1143,3 +1095,46 @@ static const struct wilc_hif_func wilc_hif_sdio = {
.disable_interrupt = wilc_sdio_disable_interrupt,
};
+static int wilc_sdio_resume(struct device *dev)
+{
+ struct sdio_func *func = dev_to_sdio_func(dev);
+ struct wilc *wilc = sdio_get_drvdata(func);
+
+ dev_info(dev, "sdio resume\n");
+ sdio_release_host(func);
+ chip_wakeup(wilc);
+ sdio_init(wilc, true);
+
+ if (wilc->suspend_event)
+ host_wakeup_notify(wilc);
+
+ chip_allow_sleep(wilc);
+
+ return 0;
+}
+
+static const struct of_device_id wilc_of_match[] = {
+ { .compatible = "microchip,wilc1000-sdio", },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, wilc_of_match);
+
+static const struct dev_pm_ops wilc_sdio_pm_ops = {
+ .suspend = wilc_sdio_suspend,
+ .resume = wilc_sdio_resume,
+};
+
+static struct sdio_driver wilc_sdio_driver = {
+ .name = SDIO_MODALIAS,
+ .id_table = wilc_sdio_ids,
+ .probe = linux_sdio_probe,
+ .remove = linux_sdio_remove,
+ .drv = {
+ .pm = &wilc_sdio_pm_ops,
+ .of_match_table = wilc_of_match,
+ }
+};
+module_driver(wilc_sdio_driver,
+ sdio_register_driver,
+ sdio_unregister_driver);
+MODULE_LICENSE("GPL");