Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1324585 > unrolled thread

[PATCH 0/3] USB: PHY: minor include cleanups

Started byBjorn Helgaas <bhelgaas@google.com>
First post2016-02-02 21:10 +0100
Last post2016-02-02 21:50 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/3] USB: PHY: minor include cleanups Bjorn Helgaas <bhelgaas@google.com> - 2016-02-02 21:10 +0100
    [PATCH 2/3] usb: phy: generic: use forward declarations instead of  #includes Bjorn Helgaas <bhelgaas@google.com> - 2016-02-02 21:10 +0100
    Re: [PATCH 0/3] USB: PHY: minor include cleanups Mark Brown <broonie@kernel.org> - 2016-02-02 21:50 +0100

#1324585 — [PATCH 0/3] USB: PHY: minor include cleanups

FromBjorn Helgaas <bhelgaas@google.com>
Date2016-02-02 21:10 +0100
Subject[PATCH 0/3] USB: PHY: minor include cleanups
Message-ID<qXPqW-8iU-15@gated-at.bofh.it>
Remove some gpio and regulator #includes when they can be replaced by
trivial forward struct declarations.  Also move a linux/gpio/consumer.h
#include from a header to the single .c files that uses it.

---

Bjorn Helgaas (3):
      usb: phy: generic: use forward declarations instead of #includes
      usb: phy: generic: use forward declarations instead of #includes
      usb: phy: phy-am335x: remove include of regulator/consumer.h


 drivers/pci/pcie/pme.c              |    4 +++-
 drivers/usb/phy/phy-am335x.c        |    1 -
 drivers/usb/phy/phy-generic.c       |    1 +
 drivers/usb/phy/phy-generic.h       |    5 +++--
 include/linux/usb/usb_phy_generic.h |    3 ++-
 5 files changed, 9 insertions(+), 5 deletions(-)

[toc] | [next] | [standalone]


#1324587 — [PATCH 2/3] usb: phy: generic: use forward declarations instead of #includes

FromBjorn Helgaas <bhelgaas@google.com>
Date2016-02-02 21:10 +0100
Subject[PATCH 2/3] usb: phy: generic: use forward declarations instead of #includes
Message-ID<qXPqX-8iU-23@gated-at.bofh.it>
In reply to#1324585
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;

[toc] | [prev] | [next] | [standalone]


#1324613

FromMark Brown <broonie@kernel.org>
Date2016-02-02 21:50 +0100
Message-ID<qXQ3E-93-3@gated-at.bofh.it>
In reply to#1324585

[Multipart message — attachments visible in raw view] — view raw

On Tue, Feb 02, 2016 at 02:02:30PM -0600, Bjorn Helgaas wrote:
> Remove some gpio and regulator #includes when they can be replaced by
> trivial forward struct declarations.  Also move a linux/gpio/consumer.h
> #include from a header to the single .c files that uses it.

Please don't CC me on patches just for simple work on users of the
regulator API - if there's some regulator specific input needed then of
course that's fine but if it's just normal API user stuff there's no
need.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web