Skip to content
Snippets Groups Projects
Commit 250f6715 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'device-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux

Pull <linux/device.h> avoidance patches from Paul Gortmaker:
 "Nearly every subsystem has some kind of header with a proto like:

	void foo(struct device *dev);

  and yet there is no reason for most of these guys to care about the
  sub fields within the device struct.  This allows us to significantly
  reduce the scope of headers including headers.  For this instance, a
  reduction of about 40% is achieved by replacing the include with the
  simple fact that the device is some kind of a struct.

  Unlike the much larger module.h cleanup, this one is simply two
  commits.  One to fix the implicit <linux/device.h> users, and then one
  to delete the device.h includes from the linux/include/ dir wherever
  possible."

* tag 'device-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux:
  device.h: audit and cleanup users in main include dir
  device.h: cleanup users outside of linux/include (C files)
parents 11bcb328 313162d0
No related merge requests found
Showing
with 23 additions and 6 deletions
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/device.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/pm.h> #include <linux/pm.h>
#include <linux/pm_clock.h> #include <linux/pm_clock.h>
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/device.h>
#include <linux/export.h> #include <linux/export.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/pm_clock.h> #include <linux/pm_clock.h>
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/cpufreq.h> #include <linux/cpufreq.h>
#include <linux/device.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/rculist.h> #include <linux/rculist.h>
#include <linux/rcupdate.h> #include <linux/rcupdate.h>
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
*/ */
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/device.h>
#include <linux/lzo.h> #include <linux/lzo.h>
#include "internal.h" #include "internal.h"
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
*/ */
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/device.h>
#include <linux/debugfs.h> #include <linux/debugfs.h>
#include <linux/rbtree.h> #include <linux/rbtree.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/export.h> #include <linux/export.h>
#include <linux/device.h>
#include <trace/events/regmap.h> #include <trace/events/regmap.h>
#include <linux/bsearch.h> #include <linux/bsearch.h>
#include <linux/sort.h> #include <linux/sort.h>
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/debugfs.h> #include <linux/debugfs.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <linux/device.h>
#include "internal.h" #include "internal.h"
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
*/ */
#include <linux/export.h> #include <linux/export.h>
#include <linux/device.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/edac.h> #include <linux/edac.h>
#include <linux/atomic.h> #include <linux/atomic.h>
#include <linux/device.h>
#include <asm/edac.h> #include <asm/edac.h>
int edac_op_state = EDAC_OPSTATE_INVAL; int edac_op_state = EDAC_OPSTATE_INVAL;
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
*/ */
#include <linux/kobject.h> #include <linux/kobject.h>
#include <linux/device.h>
#include <linux/edac.h> #include <linux/edac.h>
#include <linux/module.h> #include <linux/module.h>
#include <asm/mce.h> #include <asm/mce.h>
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <linux/mfd/wm8994/core.h> #include <linux/mfd/wm8994/core.h>
#include <linux/mfd/wm8994/registers.h> #include <linux/mfd/wm8994/registers.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/device.h>
#include "wm8994.h" #include "wm8994.h"
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/device.h>
#include <linux/power_supply.h> #include <linux/power_supply.h>
#include <linux/apm-emulation.h> #include <linux/apm-emulation.h>
......
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
* You may use this code as per GPL version 2 * You may use this code as per GPL version 2
*/ */
struct device;
struct device_type;
struct power_supply;
#ifdef CONFIG_SYSFS #ifdef CONFIG_SYSFS
extern void power_supply_init_attrs(struct device_type *dev_type); extern void power_supply_init_attrs(struct device_type *dev_type);
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/device.h>
#include <linux/power_supply.h> #include <linux/power_supply.h>
#include <linux/slab.h> #include <linux/slab.h>
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
*/ */
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/device.h>
#include <linux/power_supply.h> #include <linux/power_supply.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/stat.h> #include <linux/stat.h>
......
...@@ -25,8 +25,6 @@ ...@@ -25,8 +25,6 @@
#ifndef _SSP_PL022_H #ifndef _SSP_PL022_H
#define _SSP_PL022_H #define _SSP_PL022_H
#include <linux/device.h>
/** /**
* whether SSP is in loopback mode or not * whether SSP is in loopback mode or not
*/ */
......
...@@ -213,7 +213,6 @@ struct atm_cirange { ...@@ -213,7 +213,6 @@ struct atm_cirange {
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <linux/device.h>
#include <linux/wait.h> /* wait_queue_head_t */ #include <linux/wait.h> /* wait_queue_head_t */
#include <linux/time.h> /* struct timeval */ #include <linux/time.h> /* struct timeval */
#include <linux/net.h> #include <linux/net.h>
...@@ -250,6 +249,7 @@ struct k_atm_dev_stats { ...@@ -250,6 +249,7 @@ struct k_atm_dev_stats {
struct k_atm_aal_stats aal5; struct k_atm_aal_stats aal5;
}; };
struct device;
enum { enum {
ATM_VF_ADDR, /* Address is in use. Set by anybody, cleared ATM_VF_ADDR, /* Address is in use. Set by anybody, cleared
......
...@@ -9,10 +9,11 @@ ...@@ -9,10 +9,11 @@
#ifndef _ATTRIBUTE_CONTAINER_H_ #ifndef _ATTRIBUTE_CONTAINER_H_
#define _ATTRIBUTE_CONTAINER_H_ #define _ATTRIBUTE_CONTAINER_H_
#include <linux/device.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/klist.h> #include <linux/klist.h>
struct device;
struct attribute_container { struct attribute_container {
struct list_head node; struct list_head node;
struct klist containers; struct klist containers;
......
...@@ -9,11 +9,12 @@ ...@@ -9,11 +9,12 @@
* the Free Software Foundation * the Free Software Foundation
*/ */
#include <linux/device.h>
#include <linux/kmemcheck.h> #include <linux/kmemcheck.h>
#define C2PORT_NAME_LEN 32 #define C2PORT_NAME_LEN 32
struct device;
/* /*
* C2 port basic structs * C2 port basic structs
*/ */
......
...@@ -910,7 +910,6 @@ struct mode_page_header { ...@@ -910,7 +910,6 @@ struct mode_page_header {
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <linux/fs.h> /* not really needed, later.. */ #include <linux/fs.h> /* not really needed, later.. */
#include <linux/device.h>
#include <linux/list.h> #include <linux/list.h>
struct packet_command struct packet_command
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment