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: 67003 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp971544qge; Mon, 2 May 2016 02:06:31 -0700 (PDT) X-Received: by 10.66.66.234 with SMTP id i10mr50947523pat.114.1462179991329; Mon, 02 May 2016 02:06:31 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y22si34251782pfi.237.2016.05.02.02.06.31; Mon, 02 May 2016 02:06:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752940AbcEBJGa (ORCPT + 4 others); Mon, 2 May 2016 05:06:30 -0400 Received: from mail-oi0-f49.google.com ([209.85.218.49]:33610 "EHLO mail-oi0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752459AbcEBJG3 (ORCPT ); Mon, 2 May 2016 05:06:29 -0400 Received: by mail-oi0-f49.google.com with SMTP id v145so148939826oie.0 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=aYPWUZ3ISCPOcyqbKhOKEeTSZ1DQwwQzgZvzJjNyTwzuG4wYeaNLQlfZNm0Idt9T4Z 2hot8KJKym3PXCfgsDrhA8RPRre0PdwTNeDNcSiwLDnjJo4YGIo9pvOyN8iutQuM8CtN 2qUQB62YXEiR+k5A3OgU37ADBUiC4BlivaMyGDsvi7NDDKQrY7xC1JY7dQ4S9dFOLUoX +vUh4MGbGCRXz04EJVtmyWPC7FqDkQhnepxD2XJwt7Te7+NPRSWyGOEBtvlyYHfQ9X7J rDhks9H9USpxlTbHFQ+l2qtB8/jKZ762GvSOziKGe+y7KaXkBZJs4fU2GdM4UV3yFdMo XyGQ== X-Gm-Message-State: AOPr4FVEVABgO/bRo4KvMvYyVOEzjYfb/LkYs6UEDgCRs/wu+vZ0ujAEeUEkcjRK3TSeNXbn7Nc8TtXplcTTfZnP 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-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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);