[02/18] pata_parport: probe all units automatically

Message ID 20230215194554.25632-3-linux@zary.sk
State New
Headers
Series pata_parport: protocol drivers fixes and cleanups |

Commit Message

Ondrej Zary Feb. 15, 2023, 7:45 p.m. UTC
  Only unit 0 is probed after registering a protocol driver or attaching
a new parport. This causes bpck and bpck6 devices to be not detected
automatically.
Probe all units just like in manual device creation (using sysfs).

Signed-off-by: Ondrej Zary <linux@zary.sk>
---
 drivers/ata/pata_parport/pata_parport.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Sergey Shtylyov Feb. 18, 2023, 3:55 p.m. UTC | #1
On 2/15/23 10:45 PM, Ondrej Zary wrote:

> Only unit 0 is probed after registering a protocol driver or attaching
> a new parport. This causes bpck and bpck6 devices to be not detected
> automatically.
> Probe all units just like in manual device creation (using sysfs).
> 
> Signed-off-by: Ondrej Zary <linux@zary.sk>

Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>

[...]

MBR, Sergey
  

Patch

diff --git a/drivers/ata/pata_parport/pata_parport.c b/drivers/ata/pata_parport/pata_parport.c
index 294a266a0dda..49e99c9465fd 100644
--- a/drivers/ata/pata_parport/pata_parport.c
+++ b/drivers/ata/pata_parport/pata_parport.c
@@ -530,7 +530,7 @@  int pata_parport_register_driver(struct pi_protocol *pr)
 	if (probe) {
 		/* probe all parports using this protocol */
 		idr_for_each_entry(&parport_list, parport, port_num)
-			pi_init_one(parport, pr, -1, 0, -1);
+			pi_init_one(parport, pr, -1, -1, -1);
 	}
 	mutex_unlock(&pi_mutex);
 
@@ -665,7 +665,7 @@  static void pata_parport_attach(struct parport *port)
 	if (probe) {
 		/* probe this port using all protocols */
 		idr_for_each_entry(&protocols, pr, pr_num)
-			pi_init_one(port, pr, -1, 0, -1);
+			pi_init_one(port, pr, -1, -1, -1);
 	}
 	mutex_unlock(&pi_mutex);
 }