Skip to content

staging: comedi: cleanup the pci_dev usage

H Hartley Sweeten lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest90 patches 30 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/90staging: comedi: comedidev.h: introduce comedi_to_pci_dev() helperdrivers/staging/comedi/comedidev.h+5 -04 replies
2/90staging: comedi: adl_pci6208: store the pci_dev in the comedi_devicedrivers/staging/comedi/drivers/adl_pci6208.c+10 -90 replies
3/90staging: comedi: adl_pci7230: store the pci_dev in the comedi_devicedrivers/staging/comedi/drivers/adl_pci7230.c+11 -80 replies
4/90staging: comedi: adl_pci7230: remove the private datadrivers/staging/comedi/drivers/adl_pci7230.c+0 -90 replies
5/90staging: comedi: adl_pci7296: store the pci_dev in the comedi_devicedrivers/staging/comedi/drivers/adl_pci7296.c+11 -80 replies
6/90staging: comedi: adl_pci7296: remove the private datadrivers/staging/comedi/drivers/adl_pci7296.c+0 -90 replies
7/90staging: comedi: adl_pci7432: store the pci_dev in the comedi_devicedrivers/staging/comedi/drivers/adl_pci7432.c+11 -80 replies
8/90staging: comedi: adl_pci7432: remove the private datadrivers/staging/comedi/drivers/adl_pci7432.c+0 -90 replies
9/90staging: comedi: adl_pci8164: store the pci_dev in the comedi_devicedrivers/staging/comedi/drivers/adl_pci8164.c+11 -80 replies
10/90staging: comedi: adl_pci8164: remove the private datadrivers/staging/comedi/drivers/adl_pci8164.c+0 -90 replies
11/90staging: comedi: adl_pci9111: store the pci_dev in the comedi_devicedrivers/staging/comedi/drivers/adl_pci9111.c+16 -130 replies
12/90staging: comedi: adl_pci9118: store the pci_dev in the comedi_devicedrivers/staging/comedi/drivers/adl_pci9118.c+18 -150 replies
13/90staging: comedi: adv_pci1723: factor out the "find pci device" codedrivers/staging/comedi/drivers/adv_pci1723.c+26 -160 replies
14/90staging: comedi: adv_pci1723: cleanup "find pci device" codedrivers/staging/comedi/drivers/adv_pci1723.c+17 -460 replies
15/90staging: comedi: adv_pci1723: move comedi_pci_enable() into the attachdrivers/staging/comedi/drivers/adv_pci1723.c+5 -59 replies
16/90staging: comedi: adv_pci1723: store the pci_dev in the comedi_devicedrivers/staging/comedi/drivers/adv_pci1723.c+13 -100 replies
17/90staging: comedi: adv_pci1710: factor out the "find pci device" codedrivers/staging/comedi/drivers/adv_pci1710.c+27 -150 replies
18/90staging: comedi: adv_pci1710: cleanup "find pci device" codedrivers/staging/comedi/drivers/adv_pci1710.c+17 -460 replies
19/90staging: comedi: adv_pci1710: move comedi_pci_enable() into the attachdrivers/staging/comedi/drivers/adv_pci1710.c+6 -91 reply
20/90staging: comedi: adv_pci1710: store the pci_dev in the comedi_devicedrivers/staging/comedi/drivers/adv_pci1710.c+14 -110 replies
21/90staging: comedi: adv_pci_dio: factor out the "find pci device" codedrivers/staging/comedi/drivers/adv_pci_dio.c+29 -190 replies
22/90staging: comedi: adv_pci_dio: remove CheckAndAllocCard()drivers/staging/comedi/drivers/adv_pci_dio.c+1 -381 reply
23/90staging: comedi: adv_pci_dio: cleanup "find pci device" codedrivers/staging/comedi/drivers/adv_pci_dio.c+14 -260 replies
24/90staging: comedi: adv_pci_dio: store the pci_dev in the comedi_devicedrivers/staging/comedi/drivers/adv_pci_dio.c+12 -110 replies
25/90staging: comedi: cb_pcidas: store the pci_dev in the comedi_devicedrivers/staging/comedi/drivers/cb_pcidas.c+17 -150 replies
26/90staging: comedi: cb_pcidio: factor out the "find pci device" codedrivers/staging/comedi/drivers/cb_pcidio.c+25 -290 replies
27/90staging: comedi: cb_pcidio: cleanup "find pci device" codedrivers/staging/comedi/drivers/cb_pcidio.c+13 -180 replies
28/90staging: comedi: cb_pcidio: store the pci_dev in the comedi_devicedrivers/staging/comedi/drivers/cb_pcidio.c+12 -130 replies
29/90staging: comedi: amplc_dio200: cleanup "find pci device" codedrivers/staging/comedi/drivers/amplc_dio200.c+15 -270 replies
30/90staging: comedi: amplc_dio200: store the pci_dev in the comedi_devicedrivers/staging/comedi/drivers/amplc_dio200.c+12 -195 replies
31/90staging: comedi: amplc_pc236: cleanup "find pci device" codedrivers/staging/comedi/drivers/amplc_pc236.c+17 -260 replies
32/90staging: comedi: amplc_pc236: store the pci_dev in the comedi_devicedrivers/staging/comedi/drivers/amplc_pc236.c+12 -162 replies
33/90staging: comedi: amplc_pc263: cleanup "find pci device" codedrivers/staging/comedi/drivers/amplc_pc263.c+16 -260 replies
34/90staging: comedi: amplc_pc263: store the pci_dev in the comedi_devicedrivers/staging/comedi/drivers/amplc_pc263.c+9 -311 reply
35/90staging: comedi: amplc_pci224: cleanup "find pci device" codedrivers/staging/comedi/drivers/amplc_pci224.c+16 -270 replies
36/90staging: comedi: amplc_pci224: store the pci_dev in the comedi_devicedrivers/staging/comedi/drivers/amplc_pci224.c+10 -90 replies
37/90staging: comedi: amplc_pci230: cleanup "find pci device" codedrivers/staging/comedi/drivers/amplc_pci230.c+8 -140 replies
38/90staging: comedi: amplc_pci230: store the pci_dev in the comedi_devicedrivers/staging/comedi/drivers/amplc_pci230.c+11 -140 replies
39/90staging: comedi: cb_pcidas64: factor out the "find pci device" codedrivers/staging/comedi/drivers/cb_pcidas64.c+29 -280 replies
40/90staging: comedi: cb_pcidas64: cleanup "find pci device" codedrivers/staging/comedi/drivers/cb_pcidas64.c+15 -190 replies
41/90staging: comedi: cb_pcidas64: store the pci_dev in the comedi_devicedrivers/staging/comedi/drivers/cb_pcidas64.c+21 -180 replies
42/90staging: comedi: cb_pcidda: factor out the "find pci device" codedrivers/staging/comedi/drivers/cb_pcidda.c+32 -280 replies
43/90staging: comedi: cb_pcidda: cleanup "find pci device" codedrivers/staging/comedi/drivers/cb_pcidda.c+18 -190 replies
44/90staging: comedi: cb_pcidda: store the pci_dev in the comedi_devicedrivers/staging/comedi/drivers/cb_pcidda.c+10 -130 replies
45/90staging: comedi: cb_pcidio: store the iobase in the comedi_devicedrivers/staging/comedi/drivers/cb_pcidio.c+4 -70 replies
46/90staging: comedi: cb_pcidio: remove the private datadrivers/staging/comedi/drivers/cb_pcidio.c+0 -240 replies
47/90staging: comedi: cb_pcimdas: factor out the "find pci device" codedrivers/staging/comedi/drivers/cb_pcimdas.c+32 -290 replies
48/90staging: comedi: cb_pcimdas: cleanup "find pci device" codedrivers/staging/comedi/drivers/cb_pcimdas.c+15 -230 replies
49/90staging: comedi: cb_pcimdas: remove the debug print of the pci barsdrivers/staging/comedi/drivers/cb_pcimdas.c+0 -60 replies
50/90staging: comedi: cb_pcimdas: cleanup the private datadrivers/staging/comedi/drivers/cb_pcimdas.c+0 -90 replies
51/90staging: comedi: cb_pcimdas: remove BADR1 from the private datadrivers/staging/comedi/drivers/cb_pcimdas.c+0 -30 replies
52/90staging: comedi: cb_pcimdas: remove BADR4 from the private datadrivers/staging/comedi/drivers/cb_pcimdas.c+3 -40 replies
53/90staging: comedi: cb_pcimdas: remove BADR2 from the private datadrivers/staging/comedi/drivers/cb_pcimdas.c+5 -70 replies
54/90staging: comedi: cb_pcimdas: remove BADR0 from the private datadrivers/staging/comedi/drivers/cb_pcimdas.c+1 -40 replies
55/90staging: comedi: cb_pcimdas: store the pci_dev in the comedi_devicedrivers/staging/comedi/drivers/cb_pcimdas.c+13 -160 replies
56/90staging: comedi: contec_pci_dio: factor out the "find pci device" codedrivers/staging/comedi/drivers/contec_pci_dio.c+50 -420 replies
57/90staging: comedi: contec_pci_dio: cleanup "find pci device" codedrivers/staging/comedi/drivers/contec_pci_dio.c+15 -120 replies
58/90staging: comedi: contec_pci_dio: store the pci_dev in the comedi_devicedrivers/staging/comedi/drivers/contec_pci_dio.c+6 -70 replies
59/90staging: comedi: contec_pci_dio: remove the private datadrivers/staging/comedi/drivers/contec_pci_dio.c+0 -90 replies
60/90staging: comedi: daqboard2000: factor out the "find pci device" codedrivers/staging/comedi/drivers/daqboard2000.c+39 -290 replies
61/90staging: comedi: daqboard2000: cleanup "find pci device" codedrivers/staging/comedi/drivers/daqboard2000.c+20 -360 replies
62/90staging: comedi: daqboard2000: remove 'got_regions' from private datadrivers/staging/comedi/drivers/daqboard2000.c+4 -50 replies
63/90staging: comedi: daqboard2000: store the pci_dev in the comedi_devicedrivers/staging/comedi/drivers/daqboard2000.c+8 -70 replies
64/90staging: comedi: daqboard2000: void *plx should be a void __iomem *drivers/staging/comedi/drivers/daqboard2000.c+1 -10 replies
65/90staging: comedi: dt3000: cleanup "find pci device" codedrivers/staging/comedi/drivers/dt3000.c+31 -541 reply
66/90staging: comedi: dt3000: move the setup_pci() code into the attachdrivers/staging/comedi/drivers/dt3000.c+6 -230 replies
67/90staging: comedi: dt3000: remove 'phys_addr' from the private datadrivers/staging/comedi/drivers/dt3000.c+3 -41 reply
68/90staging: comedi: dt3000: store the pci_dev in the comedi_devicedrivers/staging/comedi/drivers/dt3000.c+8 -80 replies
69/90staging: comedi: dyna_pci10xx: factor out the "find pci device" codedrivers/staging/comedi/drivers/dyna_pci10xx.c+38 -330 replies
70/90staging: comedi: dyna_pci10xx: cleanup "find pci device" codedrivers/staging/comedi/drivers/dyna_pci10xx.c+17 -410 replies
71/90staging: comedi: dyna_pci10xx: remove the 'start_stop_sem' mutexdrivers/staging/comedi/drivers/dyna_pci10xx.c+2 -130 replies
72/90staging: comedi: dyna_pci10xx: remove 'valid' from the private datadrivers/staging/comedi/drivers/dyna_pci10xx.c+0 -30 replies
73/90staging: comedi: dyna_pci10xx: remove unused bars from the private datadrivers/staging/comedi/drivers/dyna_pci10xx.c+1 -60 replies
74/90staging: comedi: dyna_pci10xx: use dev->iobasedrivers/staging/comedi/drivers/dyna_pci10xx.c+5 -50 replies
75/90staging: comedi: dyna_pci10xx: store the pci_dev in the comedi_devicedrivers/staging/comedi/drivers/dyna_pci10xx.c+6 -60 replies
76/90staging: comedi: dyna_pci10xx: fix detachdrivers/staging/comedi/drivers/dyna_pci10xx.c+3 -10 replies
77/90staging: comedi: ke_counter: factor out the "find pci device" codedrivers/staging/comedi/drivers/ke_counter.c+26 -110 replies
78/90staging: comedi: ke_counter: cleanup "find pci device" codedrivers/staging/comedi/drivers/ke_counter.c+23 -370 replies
79/90staging: comedi: ke_counter: minor cleanup of cnt_attach()drivers/staging/comedi/drivers/ke_counter.c+8 -80 replies
80/90staging: comedi: ke_counter: store the pci_dev in the comedi_devicedrivers/staging/comedi/drivers/ke_counter.c+6 -180 replies
81/90staging: comedi: ke_counter: remove the cnt_board_nbr macrodrivers/staging/comedi/drivers/ke_counter.c+1 -30 replies
82/90staging: comedi: me_daq: factor out the "find pci device" codedrivers/staging/comedi/drivers/me_daq.c+30 -190 replies
83/90staging: comedi: me_daq: cleanup "find pci device" codedrivers/staging/comedi/drivers/me_daq.c+23 -400 replies
84/90staging: comedi: me_daq: store the pci_dev in the comedi_devicedrivers/staging/comedi/drivers/me_daq.c+8 -70 replies
85/90staging: comedi: rtd520: remove the debug print of the pci addressesdrivers/staging/comedi/drivers/rtd520.c+0 -40 replies
86/90staging: comedi: rtd520: remove 'got_regions' from private datadrivers/staging/comedi/drivers/rtd520.c+3 -61 reply
87/90staging: comedi: rtd520: remove the '#if 0' code in the attachdrivers/staging/comedi/drivers/rtd520.c+0 -460 replies
88/90staging: comedi: rtd520: store the pci_dev in the comedi_devicedrivers/staging/comedi/drivers/rtd520.c+24 -242 replies
89/90staging: comedi: aio_iiro_16: remove the private datadrivers/staging/comedi/drivers/aio_iiro_16.c+0 -110 replies
90/90staging: comedi: s526: remove unused variables in the private datadrivers/staging/comedi/drivers/s526.c+0 -80 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/90] staging: comedi: cleanup the pci_dev usage

All the comedi pci drivers currently store a pointer to the pci_dev in their private data. We can use the 'struct device *hw_dev' variable in the comedi_device struct instead and introduce a wrapper for to_pci_dev() to allow the drivers to easily get the pci_dev.

This patchset does just that. It also removes the private data from the drivers that no longer needed it.

Some of the drivers required a bit of cleanup to their "find pci device" code or the private data in order to make the conversion cleaner.

There are still a couple drivers, specifically the ni and addi ones, that need additional work before they can be converted cleanly.

H Hartley Sweeten (90):
staging: comedi: comedidev.h: introduce comedi_to_pci_dev() helper
staging: comedi: adl_pci6208: store the pci_dev in the comedi_device
staging: comedi: adl_pci7230: store the pci_dev in the comedi_device
staging: comedi: adl_pci7230: remove the private data
staging: comedi: adl_pci7296: store the pci_dev in the comedi_device
staging: comedi: adl_pci7296: remove the private data
staging: comedi: adl_pci7432: store the pci_dev in the comedi_device
staging: comedi: adl_pci7432: remove the private data
staging: comedi: adl_pci8164: store the pci_dev in the comedi_device
staging: comedi: adl_pci8164: remove the private data
staging: comedi: adl_pci9111: store the pci_dev in the comedi_device
staging: comedi: adl_pci9118: store the pci_dev in the comedi_device
staging: comedi: adv_pci1723: factor out the "find pci device" code
staging: comedi: adv_pci1723: cleanup "find pci device" code
staging: comedi: adv_pci1723: move comedi_pci_enable() into the attach
staging: comedi: adv_pci1723: store the pci_dev in the comedi_device
staging: comedi: adv_pci1710: factor out the "find pci device" code
staging: comedi: adv_pci1710: cleanup "find pci device" code
staging: comedi: adv_pci1710: move comedi_pci_enable() into the attach
staging: comedi: adv_pci1710: store the pci_dev in the comedi_device
staging: comedi: adv_pci_dio: factor out the "find pci device" code
staging: comedi: adv_pci_dio: remove CheckAndAllocCard()
staging: comedi: adv_pci_dio: cleanup "find pci device" code
staging: comedi: adv_pci_dio: store the pci_dev in the comedi_device
staging: comedi: cb_pcidas: store the pci_dev in the comedi_device
staging: comedi: cb_pcidio: factor out the "find pci device" code
staging: comedi: cb_pcidio: cleanup "find pci device" code
staging: comedi: cb_pcidio: store the pci_dev in the comedi_device
staging: comedi: amplc_dio200: cleanup "find pci device" code
staging: comedi: amplc_dio200: store the pci_dev in the comedi_device
staging: comedi: amplc_pc236: cleanup "find pci device" code
staging: comedi: amplc_pc236: store the pci_dev in the comedi_device
staging: comedi: amplc_pc263: cleanup "find pci device" code
staging: comedi: amplc_pc263: store the pci_dev in the comedi_device
staging: comedi: amplc_pci224: cleanup "find pci device" code
staging: comedi: amplc_pci224: store the pci_dev in the comedi_device
staging: comedi: amplc_pci230: cleanup "find pci device" code
staging: comedi: amplc_pci230: store the pci_dev in the comedi_device
staging: comedi: cb_pcidas64: factor out the "find pci device" code
staging: comedi: cb_pcidas64: cleanup "find pci device" code
staging: comedi: cb_pcidas64: store the pci_dev in the comedi_device
staging: comedi: cb_pcidda: factor out the "find pci device" code
staging: comedi: cb_pcidda: cleanup "find pci device" code
staging: comedi: cb_pcidda: store the pci_dev in the comedi_device
staging: comedi: cb_pcidio: store the iobase in the comedi_device
staging: comedi: cb_pcidio: remove the private data
staging: comedi: cb_pcimdas: factor out the "find pci device" code
staging: comedi: cb_pcimdas: cleanup "find pci device" code
staging: comedi: cb_pcimdas: remove the debug print of the pci bars
staging: comedi: cb_pcimdas: cleanup the private data
staging: comedi: cb_pcimdas: remove BADR1 from the private data
staging: comedi: cb_pcimdas: remove BADR4 from the private data
staging: comedi: cb_pcimdas: remove BADR2 from the private data
staging: comedi: cb_pcimdas: remove BADR0 from the private data
staging: comedi: cb_pcimdas: store the pci_dev in the comedi_device
staging: comedi: contec_pci_dio: factor out the "find pci device" code
staging: comedi: contec_pci_dio: cleanup "find pci device" code
staging: comedi: contec_pci_dio: store the pci_dev in the comedi_device
staging: comedi: contec_pci_dio: remove the private data
staging: comedi: daqboard2000: factor out the "find pci device" code
staging: comedi: daqboard2000: cleanup "find pci device" code
staging: comedi: daqboard2000: remove 'got_regions' from private data
staging: comedi: daqboard2000: store the pci_dev in the comedi_device
staging: comedi: daqboard2000: void *plx should be a void __iomem *
staging: comedi: dt3000: cleanup "find pci device" code
staging: comedi: dt3000: move the setup_pci() code into the attach
staging: comedi: dt3000: remove 'phys_addr' from the private data
staging: comedi: dt3000: store the pci_dev in the comedi_device
staging: comedi: dyna_pci10xx: factor out the "find pci device" code
staging: comedi: dyna_pci10xx: cleanup "find pci device" code
staging: comedi: dyna_pci10xx: remove the 'start_stop_sem' mutex
staging: comedi: dyna_pci10xx: remove 'valid' from the private data
staging: comedi: dyna_pci10xx: remove unused bars from the private data
staging: comedi: dyna_pci10xx: use dev->iobase
staging: comedi: dyna_pci10xx: store the pci_dev in the comedi_device
staging: comedi: dyna_pci10xx: fix detach
staging: comedi: ke_counter: factor out the "find pci device" code
staging: comedi: ke_counter: cleanup "find pci device" code
staging: comedi: ke_counter: minor cleanup of cnt_attach()
staging: comedi: ke_counter: store the pci_dev in the comedi_device
staging: comedi: ke_counter: remove the cnt_board_nbr macro
staging: comedi: me_daq: factor out the "find pci device" code
staging: comedi: me_daq: cleanup "find pci device" code
staging: comedi: me_daq: store the pci_dev in the comedi_device
staging: comedi: rtd520: remove the debug print of the pci addresses
staging: comedi: rtd520: remove 'got_regions' from private data
staging: comedi: rtd520: remove the '#if 0' code in the attach
staging: comedi: rtd520: store the pci_dev in the comedi_device
staging: comedi: aio_iiro_16: remove the private data
staging: comedi: s526: remove unused variables in the private data

 drivers/staging/comedi/comedidev.h              |   5 +
 drivers/staging/comedi/drivers/adl_pci6208.c    |  19 ++--
 drivers/staging/comedi/drivers/adl_pci7230.c    |  28 ++---
 drivers/staging/comedi/drivers/adl_pci7296.c    |  28 ++---
 drivers/staging/comedi/drivers/adl_pci7432.c    |  28 ++---
 drivers/staging/comedi/drivers/adl_pci8164.c    |  28 ++---
 drivers/staging/comedi/drivers/adl_pci9111.c    |  29 ++---
 drivers/staging/comedi/drivers/adl_pci9118.c    |  33 +++---
 drivers/staging/comedi/drivers/adv_pci1710.c    | 119 +++++++++-----------
 drivers/staging/comedi/drivers/adv_pci1723.c    |  96 +++++++---------
 drivers/staging/comedi/drivers/adv_pci_dio.c    | 112 +++++++------------
 drivers/staging/comedi/drivers/aio_iiro_16.c    |  11 --
 drivers/staging/comedi/drivers/amplc_dio200.c   |  73 +++++-------
 drivers/staging/comedi/drivers/amplc_pc236.c    |  71 +++++-------
 drivers/staging/comedi/drivers/amplc_pc263.c    |  82 +++++---------
 drivers/staging/comedi/drivers/amplc_pci224.c   |  62 +++++------
 drivers/staging/comedi/drivers/amplc_pci230.c   |  47 ++++----
 drivers/staging/comedi/drivers/cb_pcidas.c      |  32 +++---
 drivers/staging/comedi/drivers/cb_pcidas64.c    | 108 +++++++++---------
 drivers/staging/comedi/drivers/cb_pcidda.c      |  86 +++++++--------
 drivers/staging/comedi/drivers/cb_pcidio.c      | 109 ++++++------------
 drivers/staging/comedi/drivers/cb_pcimdas.c     | 140 +++++++++---------------
 drivers/staging/comedi/drivers/contec_pci_dio.c | 121 ++++++++++----------
 drivers/staging/comedi/drivers/daqboard2000.c   | 118 ++++++++++----------
 drivers/staging/comedi/drivers/dt3000.c         | 127 ++++++++-------------
 drivers/staging/comedi/drivers/dyna_pci10xx.c   | 136 +++++++++--------------
 drivers/staging/comedi/drivers/ke_counter.c     | 111 +++++++++----------
 drivers/staging/comedi/drivers/me_daq.c         |  99 ++++++++---------
 drivers/staging/comedi/drivers/rtd520.c         | 103 +++++------------
 drivers/staging/comedi/drivers/s526.c           |   8 --
 30 files changed, 882 insertions(+), 1287 deletions(-)
Signature · 1 line
1.7.11