Exit from ath_init() with EBUSY if the device does not have power.

This commit is contained in:
dyoung 2007-12-14 02:46:49 +00:00
parent 0c96975093
commit 552eeca6f7

View File

@ -1,4 +1,4 @@
/* $NetBSD: ath.c,v 1.95 2007/12/13 09:17:43 dyoung Exp $ */
/* $NetBSD: ath.c,v 1.96 2007/12/14 02:46:49 dyoung Exp $ */
/*-
* Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@ -41,7 +41,7 @@
__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.104 2005/09/16 10:09:23 ru Exp $");
#endif
#ifdef __NetBSD__
__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.95 2007/12/13 09:17:43 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.96 2007/12/14 02:46:49 dyoung Exp $");
#endif
/*
@ -948,6 +948,9 @@ ath_init(struct ath_softc *sc)
DPRINTF(sc, ATH_DEBUG_ANY, "%s: if_flags 0x%x\n",
__func__, ifp->if_flags);
if (!device_has_power(&sc->sc_dev))
return EBUSY;
ATH_LOCK(sc);
if ((error = ath_enable(sc)) != 0) {