From db1f3022aa84d356423957d0a1d82848480fa749 Mon Sep 17 00:00:00 2001 From: joe Date: Mon, 14 Jul 2003 18:33:55 +0000 Subject: MFNetBSD: date: 2002/10/01 01:25:25; author: thorpej; Use CFATTACH_DECL(). Not a functional change on FreeBSD. --- sys/dev/usb/uhub.c | 8 +++----- sys/dev/usb/usb_port.h | 21 +++++++++++++-------- 2 files changed, 16 insertions(+), 13 deletions(-) (limited to 'sys') diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c index 5767904..8bc0469 100644 --- a/sys/dev/usb/uhub.c +++ b/sys/dev/usb/uhub.c @@ -1,4 +1,4 @@ -/* $NetBSD: uhub.c,v 1.59 2002/09/23 05:51:20 simonb Exp $ */ +/* $NetBSD: uhub.c,v 1.61 2002/10/01 01:25:25 thorpej Exp $ */ /* $FreeBSD$ */ /* Also already merged from netbsd: @@ -108,10 +108,8 @@ Static bus_child_detached_t uhub_child_detached; USB_DECLARE_DRIVER(uhub); /* Create the driver instance for the hub connected to hub case */ -struct cfattach uhub_uhub_ca = { - sizeof(struct uhub_softc), uhub_match, uhub_attach, - uhub_detach, uhub_activate -}; +CFATTACH_DECL(uhub_uhub, sizeof(struct uhub_softc), + uhub_match, uhub_attach, uhub_detach, uhub_activate) #elif defined(__FreeBSD__) USB_DECLARE_DRIVER_INIT(uhub, DEVMETHOD(bus_driver_added, uhub_driver_added), diff --git a/sys/dev/usb/usb_port.h b/sys/dev/usb/usb_port.h index 89890c7..84c5acd 100644 --- a/sys/dev/usb/usb_port.h +++ b/sys/dev/usb/usb_port.h @@ -2,6 +2,11 @@ /* $NetBSD: usb_port.h,v 1.54 2002/03/28 21:49:19 ichiro Exp $ */ /* $FreeBSD$ */ +/* Also already merged from NetBSD: + * $NetBSD: usb_port.h,v 1.57 2002/09/27 20:42:01 thorpej Exp $ + * $NetBSD: usb_port.h,v 1.58 2002/10/01 01:25:26 thorpej Exp $ + */ + /* * Copyright (c) 1998 The NetBSD Foundation, Inc. * All rights reserved. @@ -95,6 +100,7 @@ typedef int usb_malloc_type; #define logprintf printf +#define USB_DNAME(dname) dname #define USB_DECLARE_DRIVER(dname) \ int __CONCAT(dname,_match)(struct device *, struct cfdata *, void *); \ void __CONCAT(dname,_attach)(struct device *, struct device *, void *); \ @@ -103,13 +109,12 @@ int __CONCAT(dname,_activate)(struct device *, enum devact); \ \ extern struct cfdriver __CONCAT(dname,_cd); \ \ -struct cfattach __CONCAT(dname,_ca) = { \ - sizeof(struct __CONCAT(dname,_softc)), \ - __CONCAT(dname,_match), \ - __CONCAT(dname,_attach), \ - __CONCAT(dname,_detach), \ - __CONCAT(dname,_activate), \ -} +CFATTACH_DECL(USB_DNAME(dname), \ + sizeof(struct ___CONCAT(dname,_softc)), \ + ___CONCAT(dname,_match), \ + ___CONCAT(dname,_attach), \ + ___CONCAT(dname,_detach), \ + ___CONCAT(dname,_activate)) #define USB_MATCH(dname) \ int __CONCAT(dname,_match)(struct device *parent, struct cfdata *match, void *aux) @@ -262,7 +267,7 @@ struct cfdriver __CONCAT(dname,_cd) = { \ NULL, #dname, DV_DULL \ }; \ \ -struct cfattach __CONCAT(dname,_ca) = { \ +const struct cfattach __CONCAT(dname,_ca) = { \ sizeof(struct __CONCAT(dname,_softc)), \ __CONCAT(dname,_match), \ __CONCAT(dname,_attach), \ -- cgit v1.1