From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934135AbbHKLXv (ORCPT ); Tue, 11 Aug 2015 07:23:51 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:34144 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933945AbbHKLXt (ORCPT ); Tue, 11 Aug 2015 07:23:49 -0400 Date: Tue, 11 Aug 2015 13:23:43 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] bq2415x_charger: Allow to load and use driver even if notify device is not registered yet Message-ID: <20150811112343.GA1461@pali> References: <1437860816-14141-1-git-send-email-pali.rohar@gmail.com> <20150805132652.GB26280@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20150805132652.GB26280@pali> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday 05 August 2015 15:26:52 Pali Rohár wrote: > On Saturday 25 July 2015 23:46:56 Pali Rohár wrote: > > - if (psy != bq->notify_psy) > > - return NOTIFY_OK; > > + /* Ignore event if it was not send by notify_node/notify_device */ > > + if (bq->notify_node) { > > + if (psy->dev.parent && > > + psy->dev.parent->of_node != bq->notify_node) > > + return NOTIFY_OK; > > There is missing branch for case when psy->dev.parent is NULL. Logical > error... I will send new version of patch. > > Correct logic should be: ignore psy dev which sent event if it is not > notify dev specified in board/DT config of bq2415x psy dev. > Fixed in v2. -- Pali Rohár pali.rohar@gmail.com