From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753709AbcFTTXT (ORCPT ); Mon, 20 Jun 2016 15:23:19 -0400 Received: from foss.arm.com ([217.140.101.70]:35381 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751679AbcFTTXK (ORCPT ); Mon, 20 Jun 2016 15:23:10 -0400 Subject: Re: [PATCH v2 3/3] firmware: scpi: add device power domain support using genpd To: Kevin Hilman References: <1466073481-697-1-git-send-email-sudeep.holla@arm.com> <1466073481-697-4-git-send-email-sudeep.holla@arm.com> Cc: Sudeep Holla , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Ulf Hansson , Jon Medhurst , Mathieu Poirier , Suzuki K Poulose , "Rafael J. Wysocki" From: Sudeep Holla Organization: ARM Message-ID: <5768309C.9020103@arm.com> Date: Mon, 20 Jun 2016 19:06:20 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: 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 On 20/06/16 18:53, Kevin Hilman wrote: > Sudeep Holla writes: > >> This patch hooks up the support for device power domain provided by >> SCPI using the Linux generic power domain infrastructure. >> >> Cc: "Rafael J. Wysocki" >> Cc: Kevin Hilman >> Cc: Ulf Hansson >> Cc: linux-pm@vger.kernel.org >> Signed-off-by: Sudeep Holla > > [...] > >> +static int scpi_pd_power(struct scpi_pm_domain *pd, bool power_on) >> +{ >> + int ret; >> + enum scpi_power_domain_state state; >> + >> + if (power_on) >> + state = SCPI_PD_STATE_ON; >> + else >> + state = SCPI_PD_STATE_OFF; >> + >> + ret = pd->ops->device_set_power_state(pd->domain, state); > > There should probably be some sanity checks here that these function > pointers are non-NULL. > Yes I agree. Since with the current scpi driver, if scpi_ops is populated, it's all non-NULL I skipped the sanity check as the probe will check for non-NULL scpi_ops. However, with extension work by Neil I agree, we may have to revisit all such callers. -- Regards, Sudeep