From fb23cabbc4dc0dfbefc42bc2a18e84219d21e3b4 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Mon, 2 Oct 2023 17:32:13 +0300 Subject: [PATCH] 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 --- device.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/device.c b/device.c index 826b038..a39d173 100644 --- a/device.c +++ b/device.c @@ -254,12 +254,10 @@ void device_print_status(struct device *device) void device_usb(struct device *device, bool on) { - if (device->usb) { - if (device->ppps_path) - ppps_power(device, on); - else - device->usb(device, on); - } + if (device->ppps_path) + ppps_power(device, on); + else if (device->usb) + device->usb(device, on); } int device_write(struct device *device, const void *buf, size_t len)