Re: [PATCH 3/6] ide: small ide_register_port() cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bartlomiej Zolnierkiewicz <bzolnier@xxxxxxxxx> writes:

> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@xxxxxxxxx>
> ---
>  drivers/ide/ide-probe.c |    9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
>
> Index: b/drivers/ide/ide-probe.c
> ===================================================================
> --- a/drivers/ide/ide-probe.c
> +++ b/drivers/ide/ide-probe.c
> @@ -640,14 +640,9 @@ static int ide_register_port(ide_hwif_t 
>  	/* register with global device tree */
>  	dev_set_name(&hwif->gendev, hwif->name);
>  	hwif->gendev.driver_data = hwif;
> -	if (hwif->gendev.parent == NULL) {
> -		if (hwif->dev)
> -			hwif->gendev.parent = hwif->dev;
> -		else
> -			/* Would like to do = &device_legacy */
> -			hwif->gendev.parent = NULL;
> -	}
> +	hwif->gendev.parent = hwif->dev;

This breaks ide-pmac.  It overwrites the parent that
pmac_ide_macio_attach has set.

Signed-off-by: Andreas Schwab <schwab@xxxxxxx>

diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 312127e..0db1ed9 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -649,7 +649,8 @@ static int ide_register_port(ide_hwif_t *hwif)
 	/* register with global device tree */
 	dev_set_name(&hwif->gendev, hwif->name);
 	hwif->gendev.driver_data = hwif;
-	hwif->gendev.parent = hwif->dev;
+	if (hwif->gendev.parent == NULL)
+		hwif->gendev.parent = hwif->dev;
 	hwif->gendev.release = hwif_release_dev;
 
 	ret = device_register(&hwif->gendev);

-- 
Andreas Schwab, SuSE Labs, schwab@xxxxxxx
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux