Module Name:    src
Committed By:   jakllsch
Date:           Thu Jul 21 19:05:03 UTC 2016

Modified Files:
        src/sys/dev/ata: wd.c

Log Message:
Call wd_params_to_properties() after softc is sufficently
initialized.


To generate a diff of this commit:
cvs rdiff -u -r1.422 -r1.423 src/sys/dev/ata/wd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ata/wd.c
diff -u src/sys/dev/ata/wd.c:1.422 src/sys/dev/ata/wd.c:1.423
--- src/sys/dev/ata/wd.c:1.422	Thu Jul 21 18:54:13 2016
+++ src/sys/dev/ata/wd.c	Thu Jul 21 19:05:03 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: wd.c,v 1.422 2016/07/21 18:54:13 jakllsch Exp $ */
+/*	$NetBSD: wd.c,v 1.423 2016/07/21 19:05:03 jakllsch Exp $ */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -54,7 +54,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.422 2016/07/21 18:54:13 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.423 2016/07/21 19:05:03 jakllsch Exp $");
 
 #include "opt_ata.h"
 
@@ -194,6 +194,7 @@ void  wdstart(void *);
 void  wdstart1(struct wd_softc*, struct buf *);
 void  wdrestart(void *);
 void  wddone(void *);
+static void wd_params_to_properties(struct wd_softc *);
 int   wd_get_params(struct wd_softc *, uint8_t, struct ataparams *);
 int   wd_flushcache(struct wd_softc *, int);
 int   wd_trim(struct wd_softc *, int, daddr_t, long);
@@ -411,6 +412,7 @@ out:
 	disk_init(&wd->sc_dk, device_xname(wd->sc_dev), &wddkdriver);
 	disk_attach(&wd->sc_dk);
 	wd->sc_wdc_bio.lp = wd->sc_dk.dk_label;
+	wd_params_to_properties(wd);
 	rnd_attach_source(&wd->rnd_source, device_xname(wd->sc_dev),
 			  RND_TYPE_DISK, RND_FLAG_DEFAULT);
 
@@ -1774,7 +1776,6 @@ wd_get_params(struct wd_softc *wd, uint8
 		wd->drvp->ata_vers = -1; /* Mark it as pre-ATA */
 		/* FALLTHROUGH */
 	case CMD_OK:
-		wd_params_to_properties(wd);
 		return 0;
 	default:
 		panic("wd_get_params: bad return code from ata_get_params");

Reply via email to