[PATCH 08/10] Staging: fbtft: Avoid duplicating code to check gpio.dc value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Avoid duplicating code to verify gpios.dc and call
flexfb_verify_gpios_dc instead.

Signed-off-by: Fabio Falzoi <fabio.falzoi84@xxxxxxxxx>
---
 drivers/staging/fbtft/flexfb.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/fbtft/flexfb.c b/drivers/staging/fbtft/flexfb.c
index cccb0e4..ca14919 100644
--- a/drivers/staging/fbtft/flexfb.c
+++ b/drivers/staging/fbtft/flexfb.c
@@ -299,15 +299,14 @@ static int flexfb_verify_gpios_dc(struct fbtft_par *par)
 
 static int flexfb_verify_gpios_db(struct fbtft_par *par)
 {
-	int i;
+	int i, ret;
 	int num_db = buswidth;
 
 	fbtft_par_dbg(DEBUG_VERIFY_GPIOS, par, "%s()\n", __func__);
+	ret = flexfb_verify_gpios_dc(par);
+	if (ret)
+		return ret;
 
-	if (par->gpio.dc < 0) {
-		dev_err(par->info->device, "Missing info about 'dc' gpio. Aborting.\n");
-		return -EINVAL;
-	}
 	if (par->gpio.wr < 0) {
 		dev_err(par->info->device, "Missing info about 'wr' gpio. Aborting.\n");
 		return -EINVAL;
-- 
2.1.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux