lkml.org 
[lkml]   [2016]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 2/3] usb: phy: generic: use forward declarations instead of #includes
From
Date
In drivers/usb/phy/phy-generic.h, use forward declarations for struct
regulator and struct gpio_desc instead of including
linux/regulator/consumer.h and linux/gpio/consumer.h.

phy-generic.c is included three places (phy-am335x.c, phy-generic.c,
phy-keystone.c). Of these, phy-am335x.c and phy-generic.c already include
regulator/consumer.h and phy-keystone.c doesn't need it; only phy-generic.c
uses gpiod_*() interfaces, and it already includes gpio/consumer.h.

This is a little more efficient and ensures that users of the regulator and
gpio interfaces include the relevant header files directly rather than
accidentally getting them via drivers/usb/phy/phy-generic.h.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
drivers/usb/phy/phy-generic.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/phy/phy-generic.h b/drivers/usb/phy/phy-generic.h
index 0d0eadd..cc4f1bd 100644
--- a/drivers/usb/phy/phy-generic.h
+++ b/drivers/usb/phy/phy-generic.h
@@ -2,8 +2,9 @@
#define _PHY_GENERIC_H_

#include <linux/usb/usb_phy_generic.h>
-#include <linux/gpio/consumer.h>
-#include <linux/regulator/consumer.h>
+
+struct regulator;
+struct gpio_desc;

struct usb_phy_generic {
struct usb_phy phy;
\
 
 \ /
  Last update: 2016-02-02 21:21    [W:0.067 / U:0.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site