Skip to content

Commit fb23cab

Browse files
committed
device: change device_usb logic
Allow PPPS function even if there is no device->usb callback. PPPS is useable even with no control interface. Signed-off-by: Dmitry Baryshkov <[email protected]>
1 parent f09b3e1 commit fb23cab

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

device.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,10 @@ void device_print_status(struct device *device)
254254

255255
void device_usb(struct device *device, bool on)
256256
{
257-
if (device->usb) {
258-
if (device->ppps_path)
259-
ppps_power(device, on);
260-
else
261-
device->usb(device, on);
262-
}
257+
if (device->ppps_path)
258+
ppps_power(device, on);
259+
else if (device->usb)
260+
device->usb(device, on);
263261
}
264262

265263
int device_write(struct device *device, const void *buf, size_t len)

0 commit comments

Comments
 (0)