From owner-svn-src-projects@FreeBSD.ORG Wed Feb 11 06:52:01 2015 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E61C1510; Wed, 11 Feb 2015 06:52:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7F5B90; Wed, 11 Feb 2015 06:52:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1B6q1pY001607; Wed, 11 Feb 2015 06:52:01 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1B6q1Jg001604; Wed, 11 Feb 2015 06:52:01 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201502110652.t1B6q1Jg001604@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 11 Feb 2015 06:52:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r278553 - projects/pmac_pmu/sys/powerpc/powermac X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2015 06:52:02 -0000 Author: jhibbits Date: Wed Feb 11 06:52:00 2015 New Revision: 278553 URL: https://svnweb.freebsd.org/changeset/base/278553 Log: Use symbolic constants instead of magic numbers for the device IDs. Modified: projects/pmac_pmu/sys/powerpc/powermac/macio.c projects/pmac_pmu/sys/powerpc/powermac/maciovar.h Modified: projects/pmac_pmu/sys/powerpc/powermac/macio.c ============================================================================== --- projects/pmac_pmu/sys/powerpc/powermac/macio.c Wed Feb 11 06:44:59 2015 (r278552) +++ projects/pmac_pmu/sys/powerpc/powermac/macio.c Wed Feb 11 06:52:00 2015 (r278553) @@ -913,7 +913,7 @@ macio_suspend(device_t dev) sc->sc_saved_fcrs[4] = bus_read_4(sc->sc_memr, KEYLARGO_FCR4); /* KeyLargo doesn't have FCR5. */ - if (sc->sc_devid != 0x22) + if (sc->sc_devid != KEYLARGO_DEVID) sc->sc_saved_fcrs[5] = bus_read_4(sc->sc_memr, KEYLARGO_FCR5); if (sc->sc_devid == 0x4f) { @@ -924,13 +924,14 @@ macio_suspend(device_t dev) sc->sc_saved_fcrs[10] = bus_read_4(sc->sc_memr, K2_FCR10); } - if (sc->sc_devid == 0x22) { + if (sc->sc_devid == KEYLARGO_DEVID) { return macio_suspend_keylargo(dev); - } else if (sc->sc_devid == 0x25) { + } else if (sc->sc_devid == PANGEA_DEVID) { return macio_suspend_pangea(dev); - } else if (sc->sc_devid == 0x3e) { + } else if (sc->sc_devid == INTREPID_DEVID) { return macio_suspend_intrepid(dev); - } else if (sc->sc_devid == 0x4f) { + } else if (sc->sc_devid == SHASTA_DEVID || + sc->sc_devid == K2_DEVID) { return macio_suspend_k2(dev); } @@ -942,7 +943,7 @@ macio_resume(device_t dev) { struct macio_softc *sc = device_get_softc(dev); - if (sc->sc_devid == 0x22) + if (sc->sc_devid == KEYLARGO_DEVID) bus_write_4(sc->sc_memr, KEYLARGO_MEDIABAY, sc->sc_saved_mbcr); bus_write_4(sc->sc_memr, KEYLARGO_FCR0, sc->sc_saved_fcrs[0]); Modified: projects/pmac_pmu/sys/powerpc/powermac/maciovar.h ============================================================================== --- projects/pmac_pmu/sys/powerpc/powermac/maciovar.h Wed Feb 11 06:44:59 2015 (r278552) +++ projects/pmac_pmu/sys/powerpc/powermac/maciovar.h Wed Feb 11 06:52:00 2015 (r278553) @@ -30,6 +30,11 @@ #ifndef _MACIO_MACIOVAR_H_ #define _MACIO_MACIOVAR_H_ +#define KEYLARGO_DEVID 0x22 +#define PANGEA_DEVID 0x25 +#define INTREPID_DEVID 0x3e +#define K2_DEVID 0x41 +#define SHASTA_DEVID 0x4f /* * The addr space size * XXX it would be better if this could be determined by querying the