devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] power_supply: rt9455_charger: Check if CONFIG_USB_PHY is enabled
@ 2015-06-03  8:47 Anda-Maria Nicolae
       [not found] ` <1433321223-19442-1-git-send-email-anda-maria.nicolae-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Anda-Maria Nicolae @ 2015-06-03  8:47 UTC (permalink / raw)
  To: sre, dbaryshkov, robh+dt, pawel.moll, mark.rutland,
	ijc+devicetree, galak, dwmw2, linux-pm, linux-kernel, devicetree

If CONFIG_USB_PHY is not enabled, struct notifier_block is not defined and
compilation fails. Therefore, the functions that process USB event
notifications are defined only if CONFIG_USB_PHY is enabled.
There is no need to define these functions if CONFIG_USB_PHY is not
enabled, since no USB notifications are received in this case.
Also, since rt9455_set_boost_voltage_before_boost_mode() function is
called only if USB_EVENT_ID notification is received, this function should
also be defined only if CONFIG_USB_PHY is enabled.

Signed-off-by: Anda-Maria Nicolae <anda-maria.nicolae@intel.com>
---
 drivers/power/rt9455_charger.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/power/rt9455_charger.c b/drivers/power/rt9455_charger.c
index 7c0c1ff..de86913 100644
--- a/drivers/power/rt9455_charger.c
+++ b/drivers/power/rt9455_charger.c
@@ -804,6 +804,7 @@ static int rt9455_hw_init(struct rt9455_info *info, u32 ichrg,
 	return 0;
 }
 
+#if IS_ENABLED(CONFIG_USB_PHY)
 /*
  * Before setting the charger into boost mode, boost output voltage is
  * set. This is needed because boost output voltage may differ from battery
@@ -828,6 +829,7 @@ static int rt9455_set_boost_voltage_before_boost_mode(struct rt9455_info *info)
 
 	return 0;
 }
+#endif
 
 /*
  * Before setting the charger into charge mode, battery regulation voltage is
@@ -1241,6 +1243,7 @@ static int rt9455_discover_charger(struct rt9455_info *info, u32 *ichrg,
 	return 0;
 }
 
+#if IS_ENABLED(CONFIG_USB_PHY)
 static int rt9455_usb_event_none(struct rt9455_info *info,
 				 u8 opa_mode, u8 iaicr)
 {
@@ -1445,6 +1448,7 @@ static int rt9455_usb_event(struct notifier_block *nb,
 	}
 	return NOTIFY_DONE;
 }
+#endif
 
 static void rt9455_pwr_rdy_work_callback(struct work_struct *work)
 {
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] power_supply: rt9455_charger: Check if CONFIG_USB_PHY is enabled
       [not found] ` <1433321223-19442-1-git-send-email-anda-maria.nicolae-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 2015-06-03 13:20   ` Sebastian Reichel
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Reichel @ 2015-06-03 13:20 UTC (permalink / raw)
  To: Anda-Maria Nicolae
  Cc: dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	pawel.moll-5wv7dgnIgG8, mark.rutland-5wv7dgnIgG8,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, dwmw2-wEGCiKHe2LqWVfeAwA7xHQ,
	linux-pm-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 668 bytes --]

Hi Anda-Maria,

On Wed, Jun 03, 2015 at 11:47:03AM +0300, Anda-Maria Nicolae wrote:
> If CONFIG_USB_PHY is not enabled, struct notifier_block is not defined and
> compilation fails. Therefore, the functions that process USB event
> notifications are defined only if CONFIG_USB_PHY is enabled.
> There is no need to define these functions if CONFIG_USB_PHY is not
> enabled, since no USB notifications are received in this case.
> Also, since rt9455_set_boost_voltage_before_boost_mode() function is
> called only if USB_EVENT_ID notification is received, this function should
> also be defined only if CONFIG_USB_PHY is enabled.

Thanks, queued for 4.2.

-- Sebastian

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-03 13:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-03  8:47 [PATCH] power_supply: rt9455_charger: Check if CONFIG_USB_PHY is enabled Anda-Maria Nicolae
     [not found] ` <1433321223-19442-1-git-send-email-anda-maria.nicolae-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-06-03 13:20   ` Sebastian Reichel

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).