From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
To: gregkh@linuxfoundation.org
Cc: linux-usb@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Subject: [PATCH 02/13] usb: renesas_usbhs: remove notify_hotplug callback
Date: Tue, 25 Jun 2019 14:38:46 +0900 [thread overview]
Message-ID: <1561441137-3090-3-git-send-email-yoshihiro.shimoda.uh@renesas.com> (raw)
In-Reply-To: <1561441137-3090-1-git-send-email-yoshihiro.shimoda.uh@renesas.com>
The notify_hotplug callback was supported in v3.10, but the last user
(armadillo800eva) was removed by the commit 1fa59bda21c7 ("ARM: shmobile:
Remove legacy board code for Armadillo-800 EVA"). So, this patch
removes it.
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
drivers/usb/renesas_usbhs/common.c | 16 ++++------------
drivers/usb/renesas_usbhs/common.h | 2 ++
drivers/usb/renesas_usbhs/mod.c | 3 ++-
drivers/usb/renesas_usbhs/mod_gadget.c | 3 ++-
include/linux/usb/renesas_usbhs.h | 26 +-------------------------
5 files changed, 11 insertions(+), 39 deletions(-)
diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
index ebbe322..f6b136a 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -3,6 +3,7 @@
* Renesas USB driver
*
* Copyright (C) 2011 Renesas Solutions Corp.
+ * Copyright (C) 2019 Renesas Electronics Corporation
* Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
*/
#include <linux/clk.h>
@@ -513,7 +514,7 @@ static void usbhsc_notify_hotplug(struct work_struct *work)
usbhsc_hotplug(priv);
}
-static int usbhsc_drvcllbck_notify_hotplug(struct platform_device *pdev)
+int usbhsc_schedule_notify_hotplug(struct platform_device *pdev)
{
struct usbhs_priv *priv = usbhs_pdev_to_priv(pdev);
int delay = usbhs_get_dparam(priv, detection_delay);
@@ -667,7 +668,6 @@ static struct renesas_usbhs_platform_info *usbhs_parse_dt(struct device *dev)
static int usbhs_probe(struct platform_device *pdev)
{
struct renesas_usbhs_platform_info *info = renesas_usbhs_get_info(pdev);
- struct renesas_usbhs_driver_callback *dfunc;
struct usbhs_priv *priv;
struct resource *res, *irq_res;
int ret;
@@ -721,10 +721,6 @@ static int usbhs_probe(struct platform_device *pdev)
}
priv->pfunc = info->platform_callback;
- /* set driver callback functions for platform */
- dfunc = &info->driver_callback;
- dfunc->notify_hotplug = usbhsc_drvcllbck_notify_hotplug;
-
/* set default param if platform doesn't have */
if (!priv->dparam.pipe_configs) {
priv->dparam.pipe_configs = usbhsc_default_pipe;
@@ -818,7 +814,7 @@ static int usbhs_probe(struct platform_device *pdev)
/*
* manual call notify_hotplug for cold plug
*/
- usbhsc_drvcllbck_notify_hotplug(pdev);
+ usbhsc_schedule_notify_hotplug(pdev);
dev_info(&pdev->dev, "probed\n");
@@ -843,13 +839,9 @@ static int usbhs_probe(struct platform_device *pdev)
static int usbhs_remove(struct platform_device *pdev)
{
struct usbhs_priv *priv = usbhs_pdev_to_priv(pdev);
- struct renesas_usbhs_platform_info *info = renesas_usbhs_get_info(pdev);
- struct renesas_usbhs_driver_callback *dfunc = &info->driver_callback;
dev_dbg(&pdev->dev, "usb remove\n");
- dfunc->notify_hotplug = NULL;
-
/* power off */
if (!usbhs_get_dparam(priv, runtime_pwctrl))
usbhsc_power_ctrl(priv, 0);
@@ -894,7 +886,7 @@ static __maybe_unused int usbhsc_resume(struct device *dev)
usbhs_platform_call(priv, phy_reset, pdev);
- usbhsc_drvcllbck_notify_hotplug(pdev);
+ usbhsc_schedule_notify_hotplug(pdev);
return 0;
}
diff --git a/drivers/usb/renesas_usbhs/common.h b/drivers/usb/renesas_usbhs/common.h
index de74ebd1..b2b21fb 100644
--- a/drivers/usb/renesas_usbhs/common.h
+++ b/drivers/usb/renesas_usbhs/common.h
@@ -3,6 +3,7 @@
* Renesas USB driver
*
* Copyright (C) 2011 Renesas Solutions Corp.
+ * Copyright (C) 2019 Renesas Electronics Corporation
* Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
*/
#ifndef RENESAS_USB_DRIVER_H
@@ -317,6 +318,7 @@ void usbhs_bus_send_sof_enable(struct usbhs_priv *priv);
void usbhs_bus_send_reset(struct usbhs_priv *priv);
int usbhs_bus_get_speed(struct usbhs_priv *priv);
int usbhs_vbus_ctrl(struct usbhs_priv *priv, int enable);
+int usbhsc_schedule_notify_hotplug(struct platform_device *pdev);
/*
* frame
diff --git a/drivers/usb/renesas_usbhs/mod.c b/drivers/usb/renesas_usbhs/mod.c
index 7475c4f..540472a 100644
--- a/drivers/usb/renesas_usbhs/mod.c
+++ b/drivers/usb/renesas_usbhs/mod.c
@@ -3,6 +3,7 @@
* Renesas USB driver
*
* Copyright (C) 2011 Renesas Solutions Corp.
+ * Copyright (C) 2019 Renesas Electronics Corporation
* Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
*/
#include <linux/interrupt.h>
@@ -41,7 +42,7 @@ static int usbhsm_autonomy_irq_vbus(struct usbhs_priv *priv,
{
struct platform_device *pdev = usbhs_priv_to_pdev(priv);
- renesas_usbhs_call_notify_hotplug(pdev);
+ usbhsc_schedule_notify_hotplug(pdev);
return 0;
}
diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c
index 59cac40..0c1e8fa 100644
--- a/drivers/usb/renesas_usbhs/mod_gadget.c
+++ b/drivers/usb/renesas_usbhs/mod_gadget.c
@@ -3,6 +3,7 @@
* Renesas USB driver
*
* Copyright (C) 2011 Renesas Solutions Corp.
+ * Copyright (C) 2019 Renesas Electronics Corporation
* Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
*/
#include <linux/delay.h>
@@ -1023,7 +1024,7 @@ static int usbhsg_vbus_session(struct usb_gadget *gadget, int is_active)
gpriv->vbus_active = !!is_active;
- renesas_usbhs_call_notify_hotplug(pdev);
+ usbhsc_schedule_notify_hotplug(pdev);
return 0;
}
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h
index b2cba7c..ac601be 100644
--- a/include/linux/usb/renesas_usbhs.h
+++ b/include/linux/usb/renesas_usbhs.h
@@ -3,6 +3,7 @@
* Renesas USB
*
* Copyright (C) 2011 Renesas Solutions Corp.
+ * Copyright (C) 2019 Renesas Electronics Corporation
* Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
*
* This program is distributed in the hope that it will be useful,
@@ -33,17 +34,6 @@ enum {
};
/*
- * callback functions table for driver
- *
- * These functions are called from platform for driver.
- * Callback function's pointer will be set before
- * renesas_usbhs_platform_callback :: hardware_init was called
- */
-struct renesas_usbhs_driver_callback {
- int (*notify_hotplug)(struct platform_device *pdev);
-};
-
-/*
* callback functions for platform
*
* These functions are called from driver for platform
@@ -214,12 +204,6 @@ struct renesas_usbhs_platform_info {
struct renesas_usbhs_platform_callback platform_callback;
/*
- * driver set these callback functions pointer.
- * platform can use it on callback functions
- */
- struct renesas_usbhs_driver_callback driver_callback;
-
- /*
* option:
*
* driver use these param for some register
@@ -232,12 +216,4 @@ struct renesas_usbhs_platform_info {
*/
#define renesas_usbhs_get_info(pdev)\
((struct renesas_usbhs_platform_info *)(pdev)->dev.platform_data)
-
-#define renesas_usbhs_call_notify_hotplug(pdev) \
- ({ \
- struct renesas_usbhs_driver_callback *dc; \
- dc = &(renesas_usbhs_get_info(pdev)->driver_callback); \
- if (dc && dc->notify_hotplug) \
- dc->notify_hotplug(pdev); \
- })
#endif /* RENESAS_USB_H */
--
2.7.4
next prev parent reply other threads:[~2019-06-25 5:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-25 5:38 [PATCH 00/13] usb: renesas_usbhs: refactor this driver Yoshihiro Shimoda
2019-06-25 5:38 ` [PATCH 01/13] usb: renesas_usbhs: revise the irq_vbus comments Yoshihiro Shimoda
2019-06-25 5:38 ` Yoshihiro Shimoda [this message]
2019-06-25 5:38 ` [PATCH 03/13] usb: renesas_usbhs: move macros from mod.c to the mod.h Yoshihiro Shimoda
2019-06-25 5:38 ` [PATCH 04/13] usb: renesas_usbhs: Avoid to write platform_data's value Yoshihiro Shimoda
2019-06-25 5:38 ` [PATCH 05/13] usb: renesas_usbhs: Use a specific flag instead of type for multi_clks Yoshihiro Shimoda
2019-06-25 5:38 ` [PATCH 06/13] usb: renesas_usbhs: Remove type member from renesas_usbhs_driver_param Yoshihiro Shimoda
2019-06-25 5:38 ` [PATCH 07/13] usb: renesas_usbhs: Use dev_of_node macro instead of open coded Yoshihiro Shimoda
2019-06-25 5:38 ` [PATCH 08/13] usb: renesas_usbhs: Add has_new_pipe_configs flag Yoshihiro Shimoda
2019-06-25 5:38 ` [PATCH 09/13] usb: renesas_usbhs: Add struct device * declaration in usbhs_probe() Yoshihiro Shimoda
2019-06-25 5:38 ` [PATCH 10/13] usb: renesas_usbhs: move device tree properties parsing Yoshihiro Shimoda
2019-06-25 5:38 ` [PATCH 11/13] usb: renesas_usbhs: Add a common function for the .get_id Yoshihiro Shimoda
2019-06-25 5:38 ` [PATCH 12/13] usb: renesas_usbhs: Use renesas_usbhs_platform_info on of_device_id.data Yoshihiro Shimoda
2019-06-25 5:38 ` [PATCH 13/13] usb: renesas_usbhs: Use struct platform_callback pointer Yoshihiro Shimoda
2019-06-26 2:34 ` [PATCH 00/13] usb: renesas_usbhs: refactor this driver Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1561441137-3090-3-git-send-email-yoshihiro.shimoda.uh@renesas.com \
--to=yoshihiro.shimoda.uh@renesas.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).