Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752924AbbF3GpC (ORCPT ); Tue, 30 Jun 2015 02:45:02 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:36574 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752665AbbF3GoB (ORCPT ); Tue, 30 Jun 2015 02:44:01 -0400 From: Fabio Falzoi To: thomas.petazzoni@free-electrons.com, noralf@tronnes.org Cc: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Fabio Falzoi Subject: [PATCH 08/10] Staging: fbtft: Avoid duplicating code to check gpio.dc value Date: Tue, 30 Jun 2015 08:43:15 +0200 Message-Id: <1435646597-7612-9-git-send-email-fabio.falzoi84@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1435646597-7612-1-git-send-email-fabio.falzoi84@gmail.com> References: <1435646597-7612-1-git-send-email-fabio.falzoi84@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1241 Lines: 40 Avoid duplicating code to verify gpios.dc and call flexfb_verify_gpios_dc instead. Signed-off-by: Fabio Falzoi --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/