Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp187118ybf; Thu, 27 Feb 2020 18:56:24 -0800 (PST) X-Google-Smtp-Source: APXvYqzc5DYo/q0SAH4aQwe71EuZWooXGO9Rkq+GV4DfHgBuLAt1huyUEriVbhy9y+neBnvdhX8W X-Received: by 2002:a05:6830:18d4:: with SMTP id v20mr1626398ote.29.1582858584837; Thu, 27 Feb 2020 18:56:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582858584; cv=none; d=google.com; s=arc-20160816; b=s6Bp8FHiXrTQXJTrpoSFbL/OKEBJfnh2YZey/TOVh0+QD6jzfH5RUrpdvelGX24R4f Mw7Pr93wfQyN2QC9mBKsLvn+ckzfrrCYcTxMNCLJxgA0n3075JLwMz8eqX9L3mlBkd7A ibJoMNkxAoAQrYgY6EivzzJ5q9UBdXJWPC79y5hErMPCT+X3i64Q+mDD3U4VVQphjAdD vdhILWa3bBTEsckfG+45gAkLXCIdslxIVOyPriqcZjsEiteRdTPjTH4H7VeO6xT6HMmr lbEGRdAtwyl4A7c+lIq0hti3oZ3wojsmDRP+n3p6idGU9h2nCVdGZdc4P7Qr97PWXhIl e4xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=bD6p8dcTtfdHzz0f6asxLTnkbd00ssfd980H/08fj1I=; b=k+1r6wiPuplosUu12Nm05b4B2L3nQJ2rDZ3yeHP8PPdKZUXnuN/+xf/syV1BBsI3fY zMmCFj88ZYZXPYfbd48/CsYmtFUH+MofH9aFQVY+aKSPXMHWOCO7UquDnekDIPMrNovs wl0ecUZuyiJI1YkPehfmuoUUbGRmAJrOTeMt9p51D0h4EfWrfrY/p3+k4Qa4b2rtKcgW 55Q4Kq6Kk//VpFXwfaHcFPexf33FcJuoEZLWtjOYIO/Mu0ZtfXsrbnSvsyvDH7LAmO4J qAA6dKWEqpAihK4H8qUDT/k2Jo6gy6qygGZby3bbnuX9gNjH+Zecbm0ofQdkUYWuPE1k zKjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Hbm1HsNB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j2si747425otk.164.2020.02.27.18.56.12; Thu, 27 Feb 2020 18:56:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Hbm1HsNB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730664AbgB1Cyz (ORCPT + 99 others); Thu, 27 Feb 2020 21:54:55 -0500 Received: from mail-oi1-f193.google.com ([209.85.167.193]:34520 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726943AbgB1Cyy (ORCPT ); Thu, 27 Feb 2020 21:54:54 -0500 Received: by mail-oi1-f193.google.com with SMTP id l136so1510192oig.1 for ; Thu, 27 Feb 2020 18:54:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bD6p8dcTtfdHzz0f6asxLTnkbd00ssfd980H/08fj1I=; b=Hbm1HsNBIKexuD+XezDLN0SZgA6Z3LEpl/wpBG6jQ1++y1adMfpQFoenYs9y0uZ2iF 7tJxDr91/k6G5gcB726MxjYDJtgSJjIDXta8OcVzoFPY8H4GhqLN4YnrAi72EIII6qGA 8uRG/lYkyoBUdybV5Swb5ngu/jk7PJDylIINQ9V3Cmn3htVVZRj9A7XXgzbUD4NtM0b3 Lsvl2Tm/oSyVjBG0QRgkkAHSAn6DIU1v2VdiIOR5o0m9FEsxNcxTwIwZWHja4dIdvt6J nT5cEh7NbF48TLzQOY/YMsGsj5rNjdl3yExZcy9KbBpCJJzJ2xc226TNoGtQryuQeneh pWnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bD6p8dcTtfdHzz0f6asxLTnkbd00ssfd980H/08fj1I=; b=lXDzLKk87Gs3pavhai3MM9iXqSm35i+5HcvzTfc7B4z4FadTSGINr7Rzznw2AzVKna aKtjJVW4Rn9pjM5RK1w0vhzsvsk7SFPqW3VO2VIEs3ot88ewpfFg8LshjTFCBWYBO6ZN lvbO660boVqUli6EnRToSy4BJ+23Hvct8qRjD2yDHEGrJfBLm2g96cN7VeExXNe6Vg5N u8xDomyoF79X4knZ7W92LZdw3zR199tdrDiEtfK1DiqWuz69QfWL0O3E0YTNaR+1Czlx jd6QrNwC51Ofp13P2AnDFQ+KeLFIZZeq3FO5Q61k+1rkkKMBN7C/j2tWwUOVHBPn6ld9 nBqQ== X-Gm-Message-State: APjAAAU9dtNsFgBlOwrKJSljF3jYFGxnEe9KRHnhhpgwVCmWL11nB153 VvFOxDdmlJ16MJxhEVSW/uHla6xX3oRpoQ5m3Ls98Q== X-Received: by 2002:aca:4789:: with SMTP id u131mr1537159oia.43.1582858492144; Thu, 27 Feb 2020 18:54:52 -0800 (PST) MIME-Version: 1.0 References: <2d0854b00d7f85e988aff4f8186e8ac5d8a9aff2.1581410798.git.baolin.wang7@gmail.com> In-Reply-To: From: Saravana Kannan Date: Thu, 27 Feb 2020 18:54:16 -0800 Message-ID: Subject: Re: [PATCH] power: supply: Allow charger manager can be built as a module To: Orson Zhai Cc: Baolin Wang , sre@kernel.org, Linux PM , LKML , Lyra Zhang , Android Kernel Team Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 27, 2020 at 8:06 AM Orson Zhai wrote: > > Hi Sebastian and other guys here, > > On Tue, Feb 11, 2020 at 4:51 PM Baolin Wang wrote: > > > > Allow charger manager can be built as a module like other charger > > drivers. > > > What do you think about this patch? > We want to set charger-manager as module in our project for new Android devices. > > -Orson > > > Signed-off-by: Baolin Wang > > --- > > drivers/power/supply/Kconfig | 2 +- > > include/linux/power/charger-manager.h | 7 +------ > > 2 files changed, 2 insertions(+), 7 deletions(-) > > > > diff --git a/drivers/power/supply/Kconfig b/drivers/power/supply/Kconfig > > index 9a5591a..195bc04 100644 > > --- a/drivers/power/supply/Kconfig > > +++ b/drivers/power/supply/Kconfig > > @@ -480,7 +480,7 @@ config CHARGER_GPIO > > called gpio-charger. > > > > config CHARGER_MANAGER > > - bool "Battery charger manager for multiple chargers" > > + tristate "Battery charger manager for multiple chargers" > > depends on REGULATOR > > select EXTCON > > help > > diff --git a/include/linux/power/charger-manager.h b/include/linux/power/charger-manager.h > > index ad19e68..40493b2 100644 > > --- a/include/linux/power/charger-manager.h > > +++ b/include/linux/power/charger-manager.h > > @@ -248,11 +248,6 @@ struct charger_manager { > > u64 charging_end_time; > > }; > > > > -#ifdef CONFIG_CHARGER_MANAGER > > extern void cm_notify_event(struct power_supply *psy, > > - enum cm_event_types type, char *msg); > > -#else > > -static inline void cm_notify_event(struct power_supply *psy, > > - enum cm_event_types type, char *msg) { } > > -#endif > > + enum cm_event_types type, char *msg); > > #endif /* _CHARGER_MANAGER_H */ You are breaking the kernel if CONFIG_CHARGER_MANAGER is disabled. Why not simple change the #ifdef to #if IS_ENABLED(CONFIG_CHARGER_MANAGER) ? -Saravana