get rid of most type_data usage

Sascha Hauer s.hauer at pengutronix.de
Sat Feb 25 10:50:57 EST 2012


Both struct device_d and struct driver_d have a type_data field which
several subsystems use to get their driver structs from the device.
THe same can be archieved with using container_of. Many drivers set
type_data without ever using it. This series removes most of the uses
of this member. This leaves the use of this member to i2c and spi
which use this field to pass a i2c/spi device to the client drivers.
This can be fixed in a later series.

Sascha Hauer (13):
      fs: get fs driver using container_of
      fs: get fs device using container_of
      console: use container_of instead of type_data
      serial drivers: remove unused type_data
      serial pxa: fix unregister
      serial imx: fix unregister
      serial stm: fix unregister
      serial s3c: add a driver private struct
      net: use container_of instead of dev->type_data
      net drivers: remove unused type_data
      net fec_imx: drop type_data usage
      net fec_mpc5200: drop type_data usage
      driver: remove unused type_data field from struct driver_d

 common/console.c                    |    7 +++--
 drivers/net/altera_tse.c            |    2 -
 drivers/net/cs8900.c                |    3 +-
 drivers/net/dm9k.c                  |    1 -
 drivers/net/ep93xx.c                |    1 -
 drivers/net/fec_imx.c               |    6 ++--
 drivers/net/fec_mpc5200.c           |   12 ++++----
 drivers/net/macb.c                  |    1 -
 drivers/net/netx_eth.c              |    1 -
 drivers/net/smc91111.c              |    1 -
 drivers/net/smc911x.c               |    1 -
 drivers/net/tap.c                   |    1 -
 drivers/serial/amba-pl011.c         |    1 -
 drivers/serial/arm_dcc.c            |    1 -
 drivers/serial/atmel.c              |    1 -
 drivers/serial/linux_console.c      |    1 -
 drivers/serial/serial_altera.c      |    1 -
 drivers/serial/serial_altera_jtag.c |    1 -
 drivers/serial/serial_blackfin.c    |    1 -
 drivers/serial/serial_imx.c         |    8 +++--
 drivers/serial/serial_mpc5xxx.c     |    3 +-
 drivers/serial/serial_netx.c        |    1 -
 drivers/serial/serial_ns16550.c     |    1 -
 drivers/serial/serial_pl010.c       |    1 -
 drivers/serial/serial_pxa.c         |    7 +++-
 drivers/serial/serial_s3c.c         |   47 ++++++++++++++++++++--------------
 drivers/serial/stm-serial.c         |    9 ++++--
 fs/cramfs/cramfs.c                  |    3 +-
 fs/devfs.c                          |    1 -
 fs/fat/fat.c                        |    3 +-
 fs/fs.c                             |   38 +++++++++++++---------------
 fs/ramfs.c                          |    1 -
 fs/tftp.c                           |    3 +-
 include/driver.h                    |    6 ----
 include/fs.h                        |    3 ++
 include/net.h                       |    2 +
 net/eth.c                           |    5 +--
 37 files changed, 87 insertions(+), 99 deletions(-)



More information about the barebox mailing list