ASoC: codecs: PCM1789: unconditionally flush work
authorStefan Agner <stefan@agner.ch>
Sun, 17 Jun 2018 13:45:29 +0000 (15:45 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 18 Jun 2018 11:54:38 +0000 (12:54 +0100)
Work is guaranteed to be initialized on exit. Drop the unnecessary
if statement and always call flush_work.

This fixes a warning seen with clang:
sound/soc/codecs/pcm1789.c:265:13: warning: address of 'priv->work' will
      always evaluate to 'true' [-Wpointer-bool-conversion]
        if (&priv->work)
        ~~   ~~~~~~^~~~

Signed-off-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/pcm1789.c

index 21f15219b3ad825ebaae5f0db7b45cc59e756765..8df6447c76a668d9c301f41303fae9e86cd4c5e7 100644 (file)
@@ -262,8 +262,7 @@ int pcm1789_common_exit(struct device *dev)
 {
        struct pcm1789_private *priv = dev_get_drvdata(dev);
 
-       if (&priv->work)
-               flush_work(&priv->work);
+       flush_work(&priv->work);
 
        return 0;
 }