From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757356AbdJKIbK (ORCPT ); Wed, 11 Oct 2017 04:31:10 -0400 Received: from mail-it0-f44.google.com ([209.85.214.44]:43699 "EHLO mail-it0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757256AbdJKIbH (ORCPT ); Wed, 11 Oct 2017 04:31:07 -0400 X-Google-Smtp-Source: AOwi7QDZ7TntcA3lHrBFgxFfkB+uu+3XJe4o6HGXVSbGXRiYZC3HElhuVe9OU8hrMrgAL8eCSdPjIXI4zIku3PD87BE= MIME-Version: 1.0 In-Reply-To: <20171010212617.3397-1-atull@kernel.org> References: <20171010212617.3397-1-atull@kernel.org> From: Linus Walleij Date: Wed, 11 Oct 2017 10:31:06 +0200 Message-ID: Subject: Re: [PATCH] gpio: gpio-dwapb: add optional reset To: Alan Tull , Philipp Zabel Cc: Hoan Tran , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 10, 2017 at 11:26 PM, Alan Tull wrote: > Some platforms require reset to be released to allow register > access. > > Signed-off-by: Alan Tull Fair enough. (...) > + rst = devm_reset_control_get_optional_exclusive(dev, NULL); > + if (IS_ERR(rst)) { > + if (PTR_ERR(rst) == -EPROBE_DEFER) > + return PTR_ERR(rst); > + } else { > + reset_control_deassert(rst); > + gpio->rst = rst; > + } I do not see why any error other than -EPROBE_DEFER should be ignored? I guess the _optional API returns NULL if there is no reset line so it should be fine to just return the error on any error. > + if (gpio->rst) > + reset_control_assert(gpio->rst); Is this the right way to handle an optional reset line? Yours, Linus Walleij