From patchwork Mon Jun 20 06:40:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 9186713 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 75C3160756 for ; Mon, 20 Jun 2016 06:40:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FD2A24B44 for ; Mon, 20 Jun 2016 06:40:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5468324B5B; Mon, 20 Jun 2016 06:40:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 633C924B44 for ; Mon, 20 Jun 2016 06:40:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751954AbcFTGkn (ORCPT ); Mon, 20 Jun 2016 02:40:43 -0400 Received: from sauhun.de ([89.238.76.85]:33433 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751946AbcFTGkn (ORCPT ); Mon, 20 Jun 2016 02:40:43 -0400 Received: from dslb-178-008-074-236.178.008.pools.vodafone-ip.de ([178.8.74.236]:49912 helo=localhost) by pokefinder.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1bEssp-000255-8a; Mon, 20 Jun 2016 08:40:39 +0200 From: Wolfram Sang To: linux-gpio@vger.kernel.org Cc: Wolfram Sang , linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven Subject: [RFC] pinctrl: sh-pfc: propagate errors on group config Date: Mon, 20 Jun 2016 08:40:22 +0200 Message-Id: <1466404822-2540-1-git-send-email-wsa@the-dreams.de> X-Mailer: git-send-email 2.8.1 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wolfram Sang On group configuration, bail out if setting one of the individual pins fails. We don't need to roll-back, the pinctrl core will do this for us. Signed-off-by: Wolfram Sang --- Tested on a Lager and Salvator-X without problems. Needs probably more testing on various HW to avoid regressions? drivers/pinctrl/sh-pfc/pinctrl.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/sh-pfc/pinctrl.c b/drivers/pinctrl/sh-pfc/pinctrl.c index d4e65bc7dacd67..c52ca5873974f3 100644 --- a/drivers/pinctrl/sh-pfc/pinctrl.c +++ b/drivers/pinctrl/sh-pfc/pinctrl.c @@ -739,13 +739,16 @@ static int sh_pfc_pinconf_group_set(struct pinctrl_dev *pctldev, unsigned group, struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); const unsigned int *pins; unsigned int num_pins; - unsigned int i; + unsigned int i, ret; pins = pmx->pfc->info->groups[group].pins; num_pins = pmx->pfc->info->groups[group].nr_pins; - for (i = 0; i < num_pins; ++i) - sh_pfc_pinconf_set(pctldev, pins[i], configs, num_configs); + for (i = 0; i < num_pins; ++i) { + ret = sh_pfc_pinconf_set(pctldev, pins[i], configs, num_configs); + if (ret) + return ret; + } return 0; }