From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753284AbcFJMLX (ORCPT ); Fri, 10 Jun 2016 08:11:23 -0400 Received: from mail-lf0-f46.google.com ([209.85.215.46]:34057 "EHLO mail-lf0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751225AbcFJMLV (ORCPT ); Fri, 10 Jun 2016 08:11:21 -0400 Subject: Re: [PATCH] platform: don't return 0 from platform_get_irq[_byname]() on error To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org References: <2253608.yVZdxzQuTN@wasted.cogentembedded.com> From: Sergei Shtylyov Message-ID: Date: Fri, 10 Jun 2016 15:11:17 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <2253608.yVZdxzQuTN@wasted.cogentembedded.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello. On 5/28/2016 11:51 PM, Sergei Shtylyov wrote: > of_irq_get[_byname]() return 0 iff irq_create_of_mapping() call fails. > Returning both error code and 0 on failure is a sign of a misdesigned API. > We should rely on the platform IRQ resource in this case, not return 0, > especially as 0 can be a valid IRQ resource too... Actually, I wanted to say that returning 0 on error makes the error check unnecessarily complex and error prone bu fogrgot about that when writing the changelog. Let me know what you think... > Fixes: aff008ad813c ("platform_get_irq: Revert to platform_get_resource if of_irq_get fails") > Signed-off-by: Sergei Shtylyov > CC: stable@vger.kernel.org [...] MBR, Sergei