From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754953AbbCBTjF (ORCPT ); Mon, 2 Mar 2015 14:39:05 -0500 Received: from mail-gw2-out.broadcom.com ([216.31.210.63]:23207 "EHLO mail-gw2-out.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754007AbbCBTjC (ORCPT ); Mon, 2 Mar 2015 14:39:02 -0500 X-IronPort-AV: E=Sophos;i="5.09,677,1418112000"; d="scan'208";a="58366904" Message-ID: <54F4BC52.6030909@broadcom.com> Date: Mon, 2 Mar 2015 11:38:58 -0800 From: Scott Branden User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Dmitry Torokhov CC: , Rob Herring , Pawel Moll , Mark Rutland , "Ian Campbell" , Kumar Gala , Grant Likely , Ray Jui , Jonathan Richardson , Dmitry Torokhov , Anatol Pomazao , , , Subject: Re: [PATCH v4 2/2] Input: bcm-keypad: Add Broadcom keypad controller References: <1425141357-7807-1-git-send-email-sbranden@broadcom.com> <1425141357-7807-3-git-send-email-sbranden@broadcom.com> <20150228221022.GA36282@dtor-ws> <20150228221518.GB36282@dtor-ws> In-Reply-To: <20150228221518.GB36282@dtor-ws> 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 Hi Dmitry, Yes, please improve the driver and make the local change. Regards, Scott On 15-02-28 02:15 PM, Dmitry Torokhov wrote: > On Sat, Feb 28, 2015 at 02:10:22PM -0800, Dmitry Torokhov wrote: >> Hi Scott, >> >> On Sat, Feb 28, 2015 at 08:35:57AM -0800, Scott Branden wrote: >>> + /* Enable clock */ >>> + >>> + kp->clk = devm_clk_get(&pdev->dev, "peri_clk"); >>> + if (IS_ERR(kp->clk)) { >>> + dev_info(&pdev->dev, >>> + "No clock specified. Assuming it's enabled\n"); >> >> I was doing the final pass before applying and I think that this is not >> quite correct, as it does not handle -EPROBE_DEFER properly which is >> quite common. I think we should do something like this: >> >> error = PTR_ERR(kp->clk); >> if (error != -ENOENT) { >> if (error != -EPROBE_DEFER) >> dev_err(.. "Failed to get clock" ...); >> return error; >> } >> dev_dbg(... "No clock specified" ...); >> >> No need to resubmit if you are OK with this, I can make the change >> locally. > > Hmm, also bcm_kp_start() and bcm_kp_stop() should check if kp->clk is > valid before trying to enable/disable it. > I am ok with these changes if you want to change locally. >> >>> + } >>> + else { >> >> Checkpach should have warned you that it should have been "} else {"; >> I'll fix it up locally along with few other cosmetic changes and >> dropping a few extra headers. >> >> Thanks. >> >> -- >> Dmitry >