staging: fbtft: eliminate code duplication
authorAnton Gerasimov <anton.gerasimov@openmailbox.org>
Sat, 13 Jun 2015 19:23:53 +0000 (22:23 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Jun 2015 21:50:10 +0000 (14:50 -0700)
Eliminated code duplication when searching for a display.

Signed-off-by: Anton Gerasimov <anton.gerasimov@openmailbox.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fbtft/fbtft_device.c

index e5aa533..211d504 100644 (file)
@@ -1421,8 +1421,6 @@ static int __init fbtft_device_init(void)
                                                ": failed to register SPI device\n");
                                        return ret;
                                }
-                               found = true;
-                               break;
                        } else {
                                ret = platform_device_register(p_device);
                                if (ret < 0) {
@@ -1431,9 +1429,9 @@ static int __init fbtft_device_init(void)
                                                ret);
                                        return ret;
                                }
-                               found = true;
-                               break;
                        }
+                       found = true;
+                       break;
                }
        }