From patchwork Thu Sep 15 10:39:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 9333107 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B95356077A for ; Thu, 15 Sep 2016 10:57:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A8C4129573 for ; Thu, 15 Sep 2016 10:57:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BBC42957C; Thu, 15 Sep 2016 10:57:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E00D429573 for ; Thu, 15 Sep 2016 10:57:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755183AbcIOK47 (ORCPT ); Thu, 15 Sep 2016 06:56:59 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35418 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751070AbcIOK46 (ORCPT ); Thu, 15 Sep 2016 06:56:58 -0400 Received: by mail-wm0-f65.google.com with SMTP id 133so4447314wmq.2; Thu, 15 Sep 2016 03:56:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=MhPi+g4fBHPbam+xmN3dc1TzUnWBH/GqSY+pWpqvo9E=; b=oamo08SixpSHj3Ot6ay+pjBYDQ5uYjXtUlwvnsC0s/jvhooczqMQDgXsnVQVJyu+ad ts6BuZZz2h0Vfr5ckZ2wwBGR3CEA8KdEUSPxoHqryQP6+XO1NTODpaB1aPAf7Dq90w2l uGNuxlrK1LoL7Hon0TgdhuFSiw5XgGueGOxGWeV4jsImUpPlgNZWcnym66Ej+QFnk+oq /Six+WTnG+LrO6pPx3Zayfx8liwpRzLN76BAZEvM3fjFjhIbHLGhifvpQ64mjeIoYMPh fHQnpk78dbPOEOITyiWAnJtWIv9oKn95JtU4+7KJYb4eMlw5AaDOtLg9HMmLRADo9E4P iIyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=MhPi+g4fBHPbam+xmN3dc1TzUnWBH/GqSY+pWpqvo9E=; b=XLvbYyTrUwudRicsiQNyN6+rzQm+XBUUXvs46x/EI3XFIGc8pPigXeHNOldNZDjNde IxmF65wervAQJDISp7/LNdypzi+wMzT/3UiPb89gCyCvMLWxJYjSl06s3UbjGE0ZFrs/ +pw2NJIX2quRKS1omjXArSia0qSzJo1kOadFaIAJ74tSFumN6ehpWtaaNW4mzPeIS1Bt ItGYvHxJYje9lX2rQiqEVDOxCBCTUKCSiC72tc+Qzlhz9zuqVhF5bnO6BLmruaePlhS0 O09/eODfweSeT0dYYS5+R3RvubNp4Q8jMA+rNtZa6ROpiyf+ac2WSD+sCnuaDXWRQiU4 rkqw== X-Gm-Message-State: AE9vXwOBeX5N4eLpSpwp5B8LO4UaZ5Ff259ZRO4EtQ4KzYOHBfiqot5piLUM2hozSx/pVQ== X-Received: by 10.194.3.45 with SMTP id 13mr7296815wjz.103.1473935991837; Thu, 15 Sep 2016 03:39:51 -0700 (PDT) Received: from cizrna.lan ([109.72.12.249]) by smtp.gmail.com with ESMTPSA id g7sm2770855wjc.43.2016.09.15.03.39.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Sep 2016 03:39:50 -0700 (PDT) From: Tomeu Vizoso To: linux-kernel@vger.kernel.org Cc: Tomeu Vizoso , Jon Hunter , Heiko Stuebner , "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson , Len Brown , Pavel Machek , Greg Kroah-Hartman , linux-pm@vger.kernel.org Subject: [PATCH] PM / Domains: Allow holes in genpd_data.domains array Date: Thu, 15 Sep 2016 12:39:23 +0200 Message-Id: <1473935963-8837-1-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.7.4 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In platforms such as Rockchip's, the array of domains isn't always filled without holes, as which domains are present depend on the particular SoC revision. By allowing holes to be in the array, such SoCs can still use a single set of constants to index the array of power domains. Fixes: 0159ec670763 ("PM / Domains: Verify the PM domain is present when adding a provider") Signed-off-by: Tomeu Vizoso Cc: Jon Hunter Cc: Heiko Stuebner --- drivers/base/power/domain.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index b0cf46dcae73..ce3f483ec67b 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -1581,6 +1581,8 @@ int of_genpd_add_provider_onecell(struct device_node *np, mutex_lock(&gpd_list_lock); for (i = 0; i < data->num_domains; i++) { + if (!data->domains[i]) + continue; if (!pm_genpd_present(data->domains[i])) goto error;