Remove unused var and always true check. Clean redeclaration.
This commit is contained in:
parent
aa2c061c3d
commit
c0ceea9c79
|
@ -272,7 +272,6 @@ device_get_flags(device_t dev)
|
||||||
int
|
int
|
||||||
device_set_driver(device_t dev, driver_t *driver)
|
device_set_driver(device_t dev, driver_t *driver)
|
||||||
{
|
{
|
||||||
device_method_signature_t method = NULL;
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
dev->softc = malloc(driver->softc_size);
|
dev->softc = malloc(driver->softc_size);
|
||||||
|
@ -282,7 +281,7 @@ device_set_driver(device_t dev, driver_t *driver)
|
||||||
memset(dev->softc, 0, driver->softc_size);
|
memset(dev->softc, 0, driver->softc_size);
|
||||||
dev->driver = driver;
|
dev->driver = driver;
|
||||||
|
|
||||||
for (i = 0; method == NULL && driver->methods[i].name != NULL; i++) {
|
for (i = 0; driver->methods[i].name != NULL; i++) {
|
||||||
device_method_t *mth = &driver->methods[i];
|
device_method_t *mth = &driver->methods[i];
|
||||||
|
|
||||||
if (strcmp(mth->name, "device_probe") == 0)
|
if (strcmp(mth->name, "device_probe") == 0)
|
||||||
|
@ -464,9 +463,7 @@ device_detach(device_t device)
|
||||||
|
|
||||||
if ((atomic_and(&device->flags, ~DEVICE_ATTACHED) & DEVICE_ATTACHED) != 0
|
if ((atomic_and(&device->flags, ~DEVICE_ATTACHED) & DEVICE_ATTACHED) != 0
|
||||||
&& device->methods.detach != NULL) {
|
&& device->methods.detach != NULL) {
|
||||||
int result = B_OK;
|
int result = stop_wlan(device);
|
||||||
|
|
||||||
result = stop_wlan(device);
|
|
||||||
if (result != 0) {
|
if (result != 0) {
|
||||||
atomic_or(&device->flags, DEVICE_ATTACHED);
|
atomic_or(&device->flags, DEVICE_ATTACHED);
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in New Issue