Module Name: src
Committed By: jdolecek
Date: Mon Feb 10 20:11:48 UTC 2020
Modified Files:
src/sys/dev/ic: wdc.c
Log Message:
use wdc_maxdrives for atabus_alloc_drives() also in wdc_sataprobe()
instead of magic 1; no functional change, all wdc_sataprobe() users
actually set wdc_maxdrives to 1
To generate a diff of this commit:
cvs rdiff -u -r1.296 -r1.297 src/sys/dev/ic/wdc.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/ic/wdc.c
diff -u src/sys/dev/ic/wdc.c:1.296 src/sys/dev/ic/wdc.c:1.297
--- src/sys/dev/ic/wdc.c:1.296 Fri Dec 27 09:41:50 2019
+++ src/sys/dev/ic/wdc.c Mon Feb 10 20:11:48 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: wdc.c,v 1.296 2019/12/27 09:41:50 msaitoh Exp $ */
+/* $NetBSD: wdc.c,v 1.297 2020/02/10 20:11:48 jdolecek Exp $ */
/*
* Copyright (c) 1998, 2001, 2003 Manuel Bouyer. All rights reserved.
@@ -58,7 +58,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.296 2019/12/27 09:41:50 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.297 2020/02/10 20:11:48 jdolecek Exp $");
#include "opt_ata.h"
#include "opt_wdc.h"
@@ -203,6 +203,7 @@ wdc_allocate_regs(struct wdc_softc *wdc)
void
wdc_sataprobe(struct ata_channel *chp)
{
+ struct wdc_softc *wdc = CHAN_TO_WDC(chp);
struct wdc_regs *wdr = CHAN_TO_WDC_REGS(chp);
uint8_t st = 0, sc __unused, sn __unused, cl, ch;
int i;
@@ -243,7 +244,7 @@ wdc_sataprobe(struct ata_channel *chp)
"cl=0x%x ch=0x%x\n",
device_xname(chp->ch_atac->atac_dev), chp->ch_channel,
sc, sn, cl, ch), DEBUG_PROBE);
- if (atabus_alloc_drives(chp, 1) != 0)
+ if (atabus_alloc_drives(chp, wdc->wdc_maxdrives) != 0)
return;
/*
* sc and sn are supposed to be 0x1 for ATAPI, but in some