Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/acpi_support/acpi_sony.c
Show First 20 Lines • Show All 108 Lines • ▼ Show 20 Lines | |||||
DRIVER_MODULE(acpi_sony, acpi, acpi_sony_driver, acpi_sony_devclass, | DRIVER_MODULE(acpi_sony, acpi, acpi_sony_driver, acpi_sony_devclass, | ||||
0, 0); | 0, 0); | ||||
MODULE_DEPEND(acpi_sony, acpi, 1, 1, 1); | MODULE_DEPEND(acpi_sony, acpi, 1, 1, 1); | ||||
static char *sny_id[] = {"SNY5001", NULL}; | static char *sny_id[] = {"SNY5001", NULL}; | ||||
static int | static int | ||||
acpi_sony_probe(device_t dev) | acpi_sony_probe(device_t dev) | ||||
{ | { | ||||
int ret = ENXIO; | int ret; | ||||
if (ACPI_ID_PROBE(device_get_parent(dev), dev, sny_id)) { | ret = ACPI_ID_PROBE(device_get_parent(dev), dev, sny_id, NULL); | ||||
if (ret <= 0) { | |||||
jhb: I would follow what you've done for other drivers here. I would also break out the side effect… | |||||
device_set_desc(dev, "Sony notebook controller"); | device_set_desc(dev, "Sony notebook controller"); | ||||
ret = 0; | |||||
} | } | ||||
return (ret); | return (ret); | ||||
} | } | ||||
static int | static int | ||||
acpi_sony_attach(device_t dev) | acpi_sony_attach(device_t dev) | ||||
{ | { | ||||
struct acpi_sony_softc *sc; | struct acpi_sony_softc *sc; | ||||
▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines |
I would follow what you've done for other drivers here. I would also break out the side effect from the if and do: