Received: by 10.223.185.116 with SMTP id b49csp897986wrg; Tue, 20 Feb 2018 09:35:35 -0800 (PST) X-Google-Smtp-Source: AH8x2257ndaPVlUAafh+EJbOYLP0/fXrvB8hYe1Q2FcgiWrGhVzrkIj/EjbwYAZlSSlIjB3aQhu/ X-Received: by 10.101.76.13 with SMTP id u13mr282971pgq.287.1519148134795; Tue, 20 Feb 2018 09:35:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519148134; cv=none; d=google.com; s=arc-20160816; b=bK39n1hKfrDfQGzxjzJ27MsRLePu+4pXqaYdTQHK3Bru12nmYoAj2Wqg/39HSNpfoW vlaDF1ZVjSKdsSoivCu0sAcc4JJSxem8CTXqhlxVE/Tl70UXyXkC2Sv1siQN78GkeGoW sNQ+AInIJkcQ+ptIuCuOkUCV6fRBSevmYtCH/7wlvElNRNFRBvBhgGzHRVGy2WRzDOWH hSKSAJhSAb+ewsf7slHXhkpHDPHOXBXm5iQ2pW5AC/jhV53qNLZW085UUzohApnOnutG gLBHMpxSxCCCGTGmtqUzwGr8HnQVtkef9TsdbZa4feJgo9if0SGYIy5I8XVYPu8Gar+b lgCg== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=kaedQOGPhrutofd1qpZdNoRhjalM69E43tIQTGZdO70=; b=RJqnQbSu+5TByf2ka+jBnoW48GLsJpKubuHTKVDEidYF7X6DgfNMovbAEjs1U/oIZN 0yG4tK5muvscjqCCTL63AUM2cdCT4KesYjHOxjINkzQh2qLL1AcapzJ1QUSdsjtsy6j9 t7TGBYIbycVBKjYqL/mnf8In3ELML7twpVVI4M4Owc8bqNAZiKce10WQl9MSDnpQPqQP f+BDA9gO+SGiu05azuaHLhlbE0eQCsUp1PJK8z6hsw87aksPt5wGoEQjSr1LGZp0GdKz CfbUgMo2VeIP/AkXYadVfRm8gppy6Nl3VuVPBXTiDB6rHId2SCYYsq95e6TkKvw1pGQo tGhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=frWeXtaN; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w4-v6si7471506plp.253.2018.02.20.09.35.19; Tue, 20 Feb 2018 09:35:34 -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=@gmail.com header.s=20161025 header.b=frWeXtaN; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753283AbeBTRek (ORCPT + 99 others); Tue, 20 Feb 2018 12:34:40 -0500 Received: from mail-qt0-f195.google.com ([209.85.216.195]:43601 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753129AbeBTRej (ORCPT ); Tue, 20 Feb 2018 12:34:39 -0500 Received: by mail-qt0-f195.google.com with SMTP id d26so17350552qtk.10; Tue, 20 Feb 2018 09:34:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=kaedQOGPhrutofd1qpZdNoRhjalM69E43tIQTGZdO70=; b=frWeXtaNKISV1Dl+vBAMqZp8PG/YEGyTIZ2KSsoxKoLW/x5b0vLfnDl8yr9yGb/qPG EPN6qWYJW08JJMoeAKn7DCokfiM/YLbSz4f7eAAZJIH9je4CRGD9GCVfEfl4OR1hukRG MTOOc6Nf/o4s2cvOYqfpYyb3itQ5VDUWgp6m+hZF+nnXCLDEuiy8nPlI3h6S2sIx70Ih VblFRDa3kki5T8vjWjOp1wzAfCLgLSKXktyTXlUVgUgrXtZrZmXbBzjAP2zWpFs2y4M0 cTIM5xhMtdUJGMeguO1wTmLs2RaNS+7/RW9EGCkVcxbywe+3q+TbAV1Q8R5rVVHvlYvi UZrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=kaedQOGPhrutofd1qpZdNoRhjalM69E43tIQTGZdO70=; b=AhUS+W4Fi6Krk8ov+5HeqW2st/j/lou76M4a9TPHpqMqxKLGNvv2HcJxnx5L7Fyum6 KJT4TNTjwLPzJ3rEWdA3mNQmjktA0OlcQ1dm8y7flYkynQQuraXkBNHmn/ybz5RtGFag NUqCKTcTgKXqRoAHe9FT0m203a1NZI2A3+YJISC29IYzJcXjwJzdr5Gd9sS2cWPMZVy/ En3EEsoXts0kW8GtJUixPiiNVs0DEO4PWGYRQ3YH/wrTIEIH4T5Kk1S0sknPPYvEmGeN CB+yFZ4jtzfrwj+hVUZfYfJCwkYlgjrFAKN8n4Au8tH1FeSiAdMdQj907vDax3jYDu+1 XZ3Q== X-Gm-Message-State: APf1xPCtVjZG0uNyXDQ/QpVPBPwoVyIsdftGOsXBjiXUO6ygnA34xNAb utEbQkcc6i3oEbkpWmH4Zj9JGi+wMpMWyZi8Aeo= X-Received: by 10.237.48.196 with SMTP id 62mr613482qtf.39.1519148078523; Tue, 20 Feb 2018 09:34:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.195.80 with HTTP; Tue, 20 Feb 2018 09:34:37 -0800 (PST) In-Reply-To: <20180220150318.138827-1-delroth@google.com> References: <20180220150318.138827-1-delroth@google.com> From: Andy Shevchenko Date: Tue, 20 Feb 2018 19:34:37 +0200 Message-ID: Subject: Re: [PATCH] max17042: propagate of_node to power supply device To: Pierre Bourdon Cc: Andre Heider , Sebastian Reichel , Linux PM , Linux Kernel Mailing List 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 Tue, Feb 20, 2018 at 5:03 PM, Pierre Bourdon wrote: > max17042_get_status uses the core power_supply_am_i_supplied. That > function relies on DT properties to figure out the power supply > topology, and will error out without DT. > + psy_cfg.of_node = dev->of_node; Perhaps do this in general manner, see how GPIOLIB takes care of it: $ git grep -n -A4 -w CONFIG_OF_GPIO -- drivers/gpio/gpiolib.c drivers/gpio/gpiolib.c:1161:#ifdef CONFIG_OF_GPIO drivers/gpio/gpiolib.c-1162- /* If the gpiochip has an assigned OF node this takes precedence */ drivers/gpio/gpiolib.c-1163- if (chip->of_node) drivers/gpio/gpiolib.c-1164- gdev->dev.of_node = chip->of_node; drivers/gpio/gpiolib.c-1165-#endif ... -- With Best Regards, Andy Shevchenko