Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/uart/uart_bus_acpi.c
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | uart_acpi_find_device(device_t dev) | ||||
} | } | ||||
return (NULL); | return (NULL); | ||||
} | } | ||||
static int | static int | ||||
uart_acpi_probe(device_t dev) | uart_acpi_probe(device_t dev) | ||||
{ | { | ||||
struct uart_softc *sc; | |||||
struct acpi_uart_compat_data *cd; | struct acpi_uart_compat_data *cd; | ||||
struct uart_softc *sc; | |||||
uint32_t rclk; | |||||
mw: Don't assign value in declaration block. | |||||
ssize_t size; | |||||
sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
if ((cd = uart_acpi_find_device(dev)) != NULL) { | cd = uart_acpi_find_device(dev); | ||||
if (cd == NULL) | |||||
return (ENXIO); | |||||
Not Done Inline Actionsmissing space after return. mw: missing space after return. | |||||
sc->sc_class = cd->cd_class; | sc->sc_class = cd->cd_class; | ||||
if (cd->cd_desc != NULL) | if (cd->cd_desc != NULL) | ||||
device_set_desc(dev, cd->cd_desc); | device_set_desc(dev, cd->cd_desc); | ||||
rclk = 0; | |||||
size = device_get_property(dev, "clock-frequency", &rclk, | |||||
sizeof(rclk), DEVICE_PROP_UINT32); | |||||
if (size < 0 || rclk == 0) | |||||
rclk = cd->cd_rclk; | |||||
return (uart_bus_probe(dev, cd->cd_regshft, cd->cd_regiowidth, | return (uart_bus_probe(dev, cd->cd_regshft, cd->cd_regiowidth, | ||||
cd->cd_rclk, 0, 0, cd->cd_quirks)); | rclk, 0, 0, cd->cd_quirks)); | ||||
} | |||||
return (ENXIO); | |||||
} | } | ||||
DRIVER_MODULE(uart, acpi, uart_acpi_driver, 0, 0); | DRIVER_MODULE(uart, acpi, uart_acpi_driver, 0, 0); |
Don't assign value in declaration block.