From: Tim Sell Date: Mon, 9 Jan 2017 18:02:22 +0000 (-0500) Subject: staging: unisys: visorbus: relocate error-check from isr to registration X-Git-Tag: v5.15~11841^2~422 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=396e36c9ace54d07e870c63fcfe6ef5cd6a22088;p=platform%2Fkernel%2Flinux-starfive.git staging: unisys: visorbus: relocate error-check from isr to registration It just makes more sense to do the NULL-pointer check when the function is called to enable interrupts, rather than on *every* interrupt. Signed-off-by: Tim Sell Signed-off-by: David Kershner Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index 8d26cc9..7c2aa79 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -438,8 +438,7 @@ dev_periodic_work(unsigned long __opaque) struct visor_device *dev = (struct visor_device *)__opaque; struct visor_driver *drv = to_visor_driver(dev->device.driver); - if (drv->channel_interrupt) - drv->channel_interrupt(dev); + drv->channel_interrupt(dev); mod_timer(&dev->timer, jiffies + POLLJIFFIES_NORMALCHANNEL); } @@ -561,6 +560,13 @@ EXPORT_SYMBOL_GPL(visorbus_write_channel); void visorbus_enable_channel_interrupts(struct visor_device *dev) { + struct visor_driver *drv = to_visor_driver(dev->device.driver); + + if (!drv->channel_interrupt) { + dev_err(&dev->device, "%s no interrupt function!\n", __func__); + return; + } + dev_start_periodic_work(dev); } EXPORT_SYMBOL_GPL(visorbus_enable_channel_interrupts);