Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp697301imm; Thu, 5 Jul 2018 07:27:28 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeGUtDpG4rWAvJZAB3PLmNUuwa5HSQ7LKy+qd9NEqxwnwzZTJ4//qWGnXy93S9RlK0fPvlo X-Received: by 2002:a17:902:988f:: with SMTP id s15-v6mr6423170plp.95.1530800848399; Thu, 05 Jul 2018 07:27:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530800848; cv=none; d=google.com; s=arc-20160816; b=S9dqecb2XUZb9sq+Wjlfb0U7GtiVPIF7f8UfFpBGT8iNNW52cendwvQZ7m51M4mN5v 3GM8P4eZ6bfgMUV6en7yiZjgjEfPY2OcGG67qjoD10FL49wO+f9mS5xBzd9m/6BX/sHF iRmqWrV55x3vt4J+oPXHysem59pJX6hSbEv1GfRKBSaASaQD7omaUsN69JX3y4ksYN21 nUsQAHRVZ4JudzXrPpm8i109i9G7T7+EXeo8i2dEP9bgklltDPAWfiiNZbzpZVmy1BeO 4fV+V33OMNnq4EPSvC6jCLWDutqz2mdUHDgpEzd6HcxoZJJOqZGF87HH13Ly5tTdxFTi kXjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:message-id:date:thread-index :thread-topic:subject:cc:to:from:arc-authentication-results; bh=5AYnIVTM0vr/ZVrlKv+gpKxGn+ZMk3C3FPYZo+MjBNY=; b=OYXDt4rQXr69yu05wnh/72VCaTZdEBiMPId0Tr3CxS9yEViY41N/NMKy6wQAq8HM+Y Rp/nTmly0KkJSjCEgHv5iWvkU+NWU68WhoKvmqR92SM80fgMewkezGtKYekq3WllCwzW DCAKi+Qy/PP2vmji2IfdtQYfZ9D71jQCLAJXTRBoIWIlwGfD/8FgR+2T8vIb1+UIhBo+ vjx2Eo/WfbXE/VTVxdIqPcsSDjLI1rUO6pclMT4MWaNF9JKaNAOU/I78ncizzaJ38d5+ N/VQUGKnsccinG5MjqqTAXjEmRr01fA806asYwwLWbWLUK0z1XMJZdLrdwUy7N54mFkT Dsog== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j72-v6si6497408pfe.187.2018.07.05.07.27.13; Thu, 05 Jul 2018 07:27:28 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754172AbeGEO0L convert rfc822-to-8bit (ORCPT + 99 others); Thu, 5 Jul 2018 10:26:11 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:3559 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753827AbeGEO0G (ORCPT ); Thu, 5 Jul 2018 10:26:06 -0400 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w65EOESl027764; Thu, 5 Jul 2018 16:25:56 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2k0dr4hjff-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 05 Jul 2018 16:25:56 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 437DE31; Thu, 5 Jul 2018 14:25:56 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag6node3.st.com [10.75.127.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id F27702064; Thu, 5 Jul 2018 14:25:55 +0000 (GMT) Received: from SFHDAG6NODE2.st.com (10.75.127.17) by SFHDAG6NODE3.st.com (10.75.127.18) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Thu, 5 Jul 2018 16:25:55 +0200 Received: from SFHDAG6NODE2.st.com ([fe80::a56f:c186:bab7:13d6]) by SFHDAG6NODE2.st.com ([fe80::a56f:c186:bab7:13d6%20]) with mapi id 15.00.1347.000; Thu, 5 Jul 2018 16:25:55 +0200 From: Pascal PAILLET-LME To: "gregkh@linuxfoundation.org" , "lgirdwood@gmail.com" , "broonie@kernel.org" , "linux-kernel@vger.kernel.org" , "benjamin.gaignard@linaro.org" CC: Pascal PAILLET-LME Subject: [PATCH 0/3] link regulator consumer with driver Thread-Topic: [PATCH 0/3] link regulator consumer with driver Thread-Index: AQHUFGwVgKIVajZUrkGpCPq4eIQdpA== Date: Thu, 5 Jul 2018 14:25:55 +0000 Message-ID: <1530800748-7300-1-git-send-email-p.paillet@st.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.75.127.51] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-05_04:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: pascal paillet The goal of this patch-set is to ensure that a regulator driver is not suspended before regulator consumer. Currently this is done by implementing suspend_late() ops in the regulator driver but this is painful for an I2C controlled regulator. Instead, the proposal is to add a device link between the driver and the consumer at regulator core framework level. To avoid storing the link pointer in the regulator core structure, we create device_link_remove() function that use the same argument as device_link_add(). pascal paillet (3): driver core: Add device_link_remove function regulator: core: Link consumer with regulator driver regulator: core: Change suspend_late to suspend drivers/base/core.c | 30 +++++++++++++++++++++++++++ drivers/regulator/core.c | 44 ++++++++++++++++++++++++++-------------- include/linux/device.h | 1 + include/linux/regulator/driver.h | 2 +- 4 files changed, 61 insertions(+), 16 deletions(-) -- 1.9.1