diff mbox series

[06/18] pata_parport: remove devtype from struct pi_adapter

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

Commit Message

Ondrej Zary Feb. 15, 2023, 7:45 p.m. UTC
Only bpck driver uses devtype but it never gets set in pata_parport.
Remove it.
As most bpck devices are CD-ROMs, always run the code that depends
on devtype == PI_PCD.

Signed-off-by: Ondrej Zary <linux@zary.sk>
---
 drivers/ata/pata_parport/bpck.c | 4 ++--
 include/linux/pata_parport.h    | 3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)

Comments

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

> Only bpck driver uses devtype but it never gets set in pata_parport.
> Remove it.
> As most bpck devices are CD-ROMs, always run the code that depends
> on devtype == PI_PCD.
> 
> Signed-off-by: Ondrej Zary <linux@zary.sk>

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

[...]

> diff --git a/drivers/ata/pata_parport/bpck.c b/drivers/ata/pata_parport/bpck.c
> index b9174cf8863c..96386a10c22f 100644
> --- a/drivers/ata/pata_parport/bpck.c
> +++ b/drivers/ata/pata_parport/bpck.c
> @@ -241,14 +241,14 @@ static void bpck_connect ( PIA *pi  )
>  
>  	WR(5,8);
>  
> -	if (pi->devtype == PI_PCD) {
> +/*	if (pi->devtype == PI_PCD) {	possibly wrong, purpose unknown */
>  		WR(0x46,0x10);		/* fiddle with ESS logic ??? */
>  		WR(0x4c,0x38);
>  		WR(0x4d,0x88);
>  		WR(0x46,0xa0);
>  		WR(0x41,0);
>  		WR(0x4e,8);
> -		}
> +/*	}*/

   You could have used // here, scripts/checkpatch.pl has nothing against it now...

[...]

MBR, Sergey
diff mbox series

Patch

diff --git a/drivers/ata/pata_parport/bpck.c b/drivers/ata/pata_parport/bpck.c
index b9174cf8863c..96386a10c22f 100644
--- a/drivers/ata/pata_parport/bpck.c
+++ b/drivers/ata/pata_parport/bpck.c
@@ -241,14 +241,14 @@  static void bpck_connect ( PIA *pi  )
 
 	WR(5,8);
 
-	if (pi->devtype == PI_PCD) {
+/*	if (pi->devtype == PI_PCD) {	possibly wrong, purpose unknown */
 		WR(0x46,0x10);		/* fiddle with ESS logic ??? */
 		WR(0x4c,0x38);
 		WR(0x4d,0x88);
 		WR(0x46,0xa0);
 		WR(0x41,0);
 		WR(0x4e,8);
-		}
+/*	}*/
 }
 
 static void bpck_disconnect ( PIA *pi )
diff --git a/include/linux/pata_parport.h b/include/linux/pata_parport.h
index 9614ce53470a..3fc6b002c7c8 100644
--- a/include/linux/pata_parport.h
+++ b/include/linux/pata_parport.h
@@ -11,15 +11,12 @@ 
 
 #include <linux/libata.h>
 
-#define PI_PCD	1	/* dummy for paride protocol modules */
-
 struct pi_adapter {
 	struct device dev;
 	struct pi_protocol *proto;	/* adapter protocol */
 	int port;			/* base address of parallel port */
 	int mode;			/* transfer mode in use */
 	int delay;			/* adapter delay setting */
-	int devtype;			/* dummy for paride protocol modules */
 	char *device;			/* dummy for paride protocol modules */
 	int unit;			/* unit number for chained adapters */
 	int saved_r0;			/* saved port state */