From patchwork Wed Nov 21 02:53:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 1777471 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id D1FD63FD8C for ; Wed, 21 Nov 2012 02:53:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754466Ab2KUCxY (ORCPT ); Tue, 20 Nov 2012 21:53:24 -0500 Received: from perceval.ideasonboard.com ([95.142.166.194]:39405 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754455Ab2KUCxX (ORCPT ); Tue, 20 Nov 2012 21:53:23 -0500 Received: from avalon.ideasonboard.com (unknown [91.178.91.187]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1951135A40 for ; Wed, 21 Nov 2012 03:53:21 +0100 (CET) From: Laurent Pinchart To: linux-sh@vger.kernel.org Subject: [PATCH 07/42] sh-pfc: Remove check for impossible error condition Date: Wed, 21 Nov 2012 03:53:23 +0100 Message-Id: <1353466438-10929-8-git-send-email-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1353466438-10929-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> References: <1353464863-10281-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> <1353466438-10929-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org The pfc pointer can't be NULL in the get and set value functions, remove the error check. Signed-off-by: Laurent Pinchart --- drivers/sh/pfc/gpio.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/sh/pfc/gpio.c b/drivers/sh/pfc/gpio.c index f22d43a..0a85159 100644 --- a/drivers/sh/pfc/gpio.c +++ b/drivers/sh/pfc/gpio.c @@ -51,7 +51,7 @@ static void sh_gpio_set_value(struct sh_pfc *pfc, unsigned gpio, int value) struct pinmux_data_reg *dr = NULL; int bit = 0; - if (!pfc || sh_pfc_get_data_reg(pfc, gpio, &dr, &bit) != 0) + if (sh_pfc_get_data_reg(pfc, gpio, &dr, &bit) != 0) BUG(); else sh_pfc_write_bit(dr, bit, value); @@ -62,7 +62,7 @@ static int sh_gpio_get_value(struct sh_pfc *pfc, unsigned gpio) struct pinmux_data_reg *dr = NULL; int bit = 0; - if (!pfc || sh_pfc_get_data_reg(pfc, gpio, &dr, &bit) != 0) + if (sh_pfc_get_data_reg(pfc, gpio, &dr, &bit) != 0) return -EINVAL; return sh_pfc_read_bit(dr, bit);