device.h: audit and cleanup users in main include dir

The <linux/device.h> header includes a lot of stuff, and
it in turn gets a lot of use just for the basic "struct device"
which appears so often.

Clean up the users as follows:

1) For those headers only needing "struct device" as a pointer
in fcn args, replace the include with exactly that.

2) For headers not really using anything from device.h, simply
delete the include altogether.

3) For headers relying on getting device.h implicitly before
being included themselves, now explicitly include device.h

4) For files in which doing #1 or #2 uncovers an implicit
dependency on some other header, fix by explicitly adding
the required header(s).

Any C files that were implicitly relying on device.h to be
present have already been dealt with in advance.

Total removals from #1 and #2: 51.  Total additions coming
from #3: 9.  Total other implicit dependencies from #4: 7.

As of 3.3-rc1, there were 110, so a net removal of 42 gives
about a 38% reduction in device.h presence in include/*

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
This commit is contained in:
Paul Gortmaker
2012-01-30 11:46:54 -05:00
parent 51990e8254
commit 313162d0b8
53 changed files with 68 additions and 52 deletions

View File

@@ -25,8 +25,6 @@
#ifndef _SSP_PL022_H
#define _SSP_PL022_H
#include <linux/device.h>
/**
* whether SSP is in loopback mode or not
*/

View File

@@ -213,7 +213,6 @@ struct atm_cirange {
#ifdef __KERNEL__
#include <linux/device.h>
#include <linux/wait.h> /* wait_queue_head_t */
#include <linux/time.h> /* struct timeval */
#include <linux/net.h>
@@ -249,6 +248,7 @@ struct k_atm_dev_stats {
struct k_atm_aal_stats aal5;
};
struct device;
enum {
ATM_VF_ADDR, /* Address is in use. Set by anybody, cleared

View File

@@ -9,10 +9,11 @@
#ifndef _ATTRIBUTE_CONTAINER_H_
#define _ATTRIBUTE_CONTAINER_H_
#include <linux/device.h>
#include <linux/list.h>
#include <linux/klist.h>
struct device;
struct attribute_container {
struct list_head node;
struct klist containers;

View File

@@ -9,11 +9,12 @@
* the Free Software Foundation
*/
#include <linux/device.h>
#include <linux/kmemcheck.h>
#define C2PORT_NAME_LEN 32
struct device;
/*
* C2 port basic structs
*/

View File

@@ -910,7 +910,6 @@ struct mode_page_header {
#ifdef __KERNEL__
#include <linux/fs.h> /* not really needed, later.. */
#include <linux/device.h>
#include <linux/list.h>
struct packet_command

View File

@@ -14,11 +14,12 @@
#ifndef _LINUX_CPU_H_
#define _LINUX_CPU_H_
#include <linux/device.h>
#include <linux/node.h>
#include <linux/compiler.h>
#include <linux/cpumask.h>
struct device;
struct cpu {
int node_id; /* The node which contains the CPU */
int hotpluggable; /* creates sysfs control file if hotpluggable */

View File

@@ -14,7 +14,6 @@
#include <linux/mutex.h>
#include <linux/notifier.h>
#include <linux/threads.h>
#include <linux/device.h>
#include <linux/kobject.h>
#include <linux/sysfs.h>
#include <linux/completion.h>

View File

@@ -3,7 +3,6 @@
#ifdef CONFIG_CRASH_DUMP
#include <linux/kexec.h>
#include <linux/device.h>
#include <linux/proc_fs.h>
#include <linux/elf.h>

View File

@@ -26,11 +26,11 @@
#include <linux/file.h>
#include <linux/err.h>
#include <linux/device.h>
#include <linux/scatterlist.h>
#include <linux/list.h>
#include <linux/dma-mapping.h>
struct device;
struct dma_buf;
struct dma_buf_attachment;

View File

@@ -13,7 +13,11 @@
#define _LINUX_EDAC_H_
#include <linux/atomic.h>
#include <linux/device.h>
#include <linux/kobject.h>
#include <linux/completion.h>
#include <linux/workqueue.h>
struct device;
#define EDAC_OPSTATE_INVAL -1
#define EDAC_OPSTATE_POLL 0

View File

@@ -407,7 +407,6 @@ struct fb_cursor {
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/workqueue.h>
#include <linux/notifier.h>
#include <linux/list.h>

View File

@@ -2,7 +2,6 @@
#define _LINUX_FIREWIRE_H
#include <linux/completion.h>
#include <linux/device.h>
#include <linux/dma-mapping.h>
#include <linux/kernel.h>
#include <linux/kref.h>
@@ -68,6 +67,8 @@
#define CSR_MODEL 0x17
#define CSR_DIRECTORY_ID 0x20
struct device;
struct fw_csr_iterator {
const u32 *p;
const u32 *end;

View File

@@ -20,6 +20,8 @@
#ifndef _LINUX_HWMON_SYSFS_H
#define _LINUX_HWMON_SYSFS_H
#include <linux/device.h>
struct sensor_device_attribute{
struct device_attribute dev_attr;
int index;

View File

@@ -14,7 +14,7 @@
#ifndef _HWMON_H_
#define _HWMON_H_
#include <linux/device.h>
struct device;
struct device *hwmon_device_register(struct device *dev);

View File

@@ -20,12 +20,12 @@
#include <linux/err.h>
#include <linux/sched.h>
#include <linux/device.h>
/* hwspinlock mode argument */
#define HWLOCK_IRQSTATE 0x01 /* Disable interrupts, save state */
#define HWLOCK_IRQ 0x02 /* Disable interrupts, don't save state */
struct device;
struct hwspinlock;
struct hwspinlock_device;
struct hwspinlock_ops;

View File

@@ -14,7 +14,6 @@
#include <linux/interrupt.h>
#include <linux/bitops.h>
#include <linux/bio.h>
#include <linux/device.h>
#include <linux/pci.h>
#include <linux/completion.h>
#include <linux/pm.h>
@@ -43,6 +42,8 @@
#define ERROR_RESET 3 /* Reset controller every 4th retry */
#define ERROR_RECAL 1 /* Recalibrate every 2nd retry */
struct device;
/* Error codes returned in rq->errors to the higher part of the driver. */
enum {
IDE_DRV_ERROR_GENERAL = 101,

View File

@@ -220,10 +220,10 @@ struct kernel_ipmi_msg {
* The in-kernel interface.
*/
#include <linux/list.h>
#include <linux/device.h>
#include <linux/proc_fs.h>
struct module;
struct device;
/* Opaque type for a IPMI message user. One of these is needed to
send and receive messages. */

View File

@@ -36,10 +36,11 @@
#include <linux/ipmi_msgdefs.h>
#include <linux/proc_fs.h>
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/ipmi.h>
struct device;
/* This files describes the interface for IPMI system management interface
drivers to bind into the IPMI message handler. */

View File

@@ -2,7 +2,7 @@
#ifndef __LINUX_JZ4740_ADC
#define __LINUX_JZ4740_ADC
#include <linux/device.h>
struct device;
/*
* jz4740_adc_set_config - Configure a JZ4740 adc device

View File

@@ -1,9 +1,9 @@
#ifndef __LINUX_MAPLE_H
#define __LINUX_MAPLE_H
#include <linux/device.h>
#include <mach/maple.h>
struct device;
extern struct bus_type maple_bus_type;
/* Maple Bus command and response codes */

Some files were not shown because too many files have changed in this diff Show More