From patchwork Mon May 2 09:06:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 8990701 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-renesas-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 665E0BF29F for ; Mon, 2 May 2016 09:06:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C7CFF201D3 for ; Mon, 2 May 2016 09:06:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1088F20145 for ; Mon, 2 May 2016 09:06:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752459AbcEBJGa (ORCPT ); Mon, 2 May 2016 05:06:30 -0400 Received: from mail-oi0-f42.google.com ([209.85.218.42]:34208 "EHLO mail-oi0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752805AbcEBJGa (ORCPT ); Mon, 2 May 2016 05:06:30 -0400 Received: by mail-oi0-f42.google.com with SMTP id k142so182369381oib.1 for ; Mon, 02 May 2016 02:06:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=wp6Ri/HkpGDFtqtVbQM+gKt4E3biM+pC0A2HVoD+1Mk=; b=ks2kZ1sROdPElVWzjiYL+rW0N89F7fVVw7UeHbL/waJWI0PZTkrbMhIhlc3udqmCg/ lryN+ziJrYXku1gmerrgRa0ndwLcpZTO1DXfqKcLKQqNfh/kfJLyWpRu92041iUstAzW kUZVbcq+6K+XlrfUlMCq7KiySksH3cGzfPCr8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=wp6Ri/HkpGDFtqtVbQM+gKt4E3biM+pC0A2HVoD+1Mk=; b=mgdtWUKeI2BGdKoag5N4KcMfkyQZlL1yJGbSyey7jgyn7J2XN/y4PRJbIykLXVG43S hw8rFhBjiJPTYbqjizi+C5DFl86II4NZLrGCkiFWa47vuUwC4x20z32z0Sa4dww3qrcz lgIC8f2juKP/8GXccy4wym8qcn6UIgxCN3OXtG74inl801uHLbOWTKwrfaHOvzufs4DO Gr2f4uTJZCbHQulMhytTfGPW0Yhdk0GP8DHBJcCDaJIGRe/GysT6Tc4l9K3/7BcElnsV LRGmjZ4vxgYANUb4Y++aNOAlNqJH6xnVsxbCibPCVTHaJ2KP1Prz8zkDNx89ImcaKc0t 2oAA== X-Gm-Message-State: AOPr4FXilcb5oLIHz52ryS7z7sbtMRMXAoIZRYQSecx+mCihK092DVYgaTztYBFBTU25qz3mEs+zLU1oKD5V+i1m MIME-Version: 1.0 X-Received: by 10.202.74.17 with SMTP id x17mr12333933oia.143.1462179989105; Mon, 02 May 2016 02:06:29 -0700 (PDT) Received: by 10.182.176.104 with HTTP; Mon, 2 May 2016 02:06:29 -0700 (PDT) In-Reply-To: References: <1461914677-24899-1-git-send-email-geert+renesas@glider.be> Date: Mon, 2 May 2016 11:06:29 +0200 Message-ID: Subject: Re: [PATCH] pinctrl: sh-pfc: Let gpio_chip.to_irq() return -ENXIO on error From: Linus Walleij To: Geert Uytterhoeven Cc: Geert Uytterhoeven , Laurent Pinchart , "linux-gpio@vger.kernel.org" , linux-renesas-soc@vger.kernel.org Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, May 2, 2016 at 11:04 AM, Geert Uytterhoeven wrote: > [silly response deleted] > > Scrap it. :D > The only annoying thing is that 0 cannot easily be propagated upstream as > an error code, so it has to be tested for explicitly. Well with the Big Penguin's clear opinion on the matter there is not much we can do. What about this? } gpios->irq[i] = ret; Yours, Linus Walleij diff --git a/drivers/tty/serial/serial_mctrl_gpio.c b/drivers/tty/serial/serial_mctrl_gpio.c index 02147361eaa9..2297ec781681 100644 --- a/drivers/tty/serial/serial_mctrl_gpio.c +++ b/drivers/tty/serial/serial_mctrl_gpio.c @@ -172,6 +172,13 @@ struct mctrl_gpios *mctrl_gpio_init(struct uart_port *port, unsigned int idx) dev_err(port->dev, "failed to find corresponding irq for %s (idx=%d, err=%d)\n", mctrl_gpios_desc[i].name, idx, ret); + /* + * Satisfy the error code semantics for a missing IRQ, + * 0 means NO_IRQ, but the framework needs to return + * a negative to deal with the error. + */ + if (!ret) + ret = -ENOSYS; return ERR_PTR(ret);