From patchwork Tue May 13 08:22:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 30006 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f200.google.com (mail-ie0-f200.google.com [209.85.223.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8C77520446 for ; Tue, 13 May 2014 08:23:06 +0000 (UTC) Received: by mail-ie0-f200.google.com with SMTP id rd18sf16677iec.3 for ; Tue, 13 May 2014 01:23:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:in-reply-to:references :date:message-id:subject:from:to:cc:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=VfVx23KVy8taWHPRUA/DrzY9iGg5qD4ntEyX8RhTGbg=; b=LYZMQwGQJiqdvjMQlAAShiYrEPi4PxjQO6aYpNRK9jDAXAIZr2r+F/eK4gxZoc2yMK g6Q6Yf/tQ7xs2yNSaVnNWLF/CssjT7/MRuHJA52EJ3zJN/+HZX4NhluTksod+MZuWBCX ubiL+2lospap6bLm9KMQUV8/ot2Ivtub1BZjp+GeU/e/kN4jM2UbibZSl3MiaYmhmJdQ 1FnrPphXdNRdhGW7e5wtIM5xSH/Fna8JleyMsXiFrLjctbjwP5I1uGr7NicLUW7UgPI4 7R0P4/ZDQYPFtrcC1OhcIc03id9WbGLfqNC02JTPXv1KqAlrrMN8mRdiq5SULNLwkXl5 seAA== X-Gm-Message-State: ALoCoQk+797NSX2FlVpZfzB6HGg1tuJeRIynaXnrDn8qvmyS1YPETH5JFEwWNNyCcqoK1nfMDpIt X-Received: by 10.182.104.200 with SMTP id gg8mr16814391obb.45.1399969386452; Tue, 13 May 2014 01:23:06 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.87.33 with SMTP id q30ls1791788qgd.10.gmail; Tue, 13 May 2014 01:23:06 -0700 (PDT) X-Received: by 10.52.90.37 with SMTP id bt5mr23654777vdb.7.1399969386295; Tue, 13 May 2014 01:23:06 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id pd4si2517451veb.213.2014.05.13.01.23.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 May 2014 01:23:06 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id hr9so10317967vcb.31 for ; Tue, 13 May 2014 01:23:06 -0700 (PDT) X-Received: by 10.52.0.193 with SMTP id 1mr23289011vdg.0.1399969386226; Tue, 13 May 2014 01:23:06 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp132360vcb; Tue, 13 May 2014 01:23:05 -0700 (PDT) X-Received: by 10.66.119.172 with SMTP id kv12mr62608772pab.34.1399969385138; Tue, 13 May 2014 01:23:05 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id iu4si7596075pbc.430.2014.05.13.01.23.04; Tue, 13 May 2014 01:23:04 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759452AbaEMIWz (ORCPT + 27 others); Tue, 13 May 2014 04:22:55 -0400 Received: from mail-oa0-f47.google.com ([209.85.219.47]:38984 "EHLO mail-oa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752692AbaEMIWv (ORCPT ); Tue, 13 May 2014 04:22:51 -0400 Received: by mail-oa0-f47.google.com with SMTP id i7so2421oag.20 for ; Tue, 13 May 2014 01:22:51 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.132.236 with SMTP id ox12mr1047137oeb.81.1399969371264; Tue, 13 May 2014 01:22:51 -0700 (PDT) Received: by 10.182.28.168 with HTTP; Tue, 13 May 2014 01:22:51 -0700 (PDT) In-Reply-To: <1399966890-22926-1-git-send-email-k.chander@samsung.com> References: <1399966890-22926-1-git-send-email-k.chander@samsung.com> Date: Tue, 13 May 2014 13:52:51 +0530 Message-ID: Subject: Re: [PATCH] PM / OPP: discard duplicate OPP additions From: Viresh Kumar To: "[Chander Kashyap" Cc: "linux-pm@vger.kernel.org" , Linux Kernel Mailing List , "Rafael J. Wysocki" , Pavel Machek , "Brown, Len" , Greg Kroah-Hartman , Chander Kashyap , Inderpal Singh Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On 13 May 2014 13:11, [Chander Kashyap wrote: What happened to your name ? "[" > From: Chander Kashyap > > It may be possible to unregister and re-register the cpufreq driver. > One such example is arm big-little IKS cpufreq driver. While > re-registering the driver, same OPPs may get added again. > > This patch detects the duplicacy and discards them. > > Signed-off-by: Chander Kashyap > Signed-off-by: Inderpal Singh > --- > drivers/base/power/opp.c | 28 +++++++++++++++++++--------- > 1 file changed, 19 insertions(+), 9 deletions(-) I wouldn't say that this approach is particularly bad or wrong, but what about this instead? --- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c index 2553867..7efdaf3 100644 --- a/drivers/base/power/opp.c +++ b/drivers/base/power/opp.c @@ -713,6 +713,11 @@ int of_init_opp_table(struct device *dev) const __be32 *val; int nr; + if (!IS_ERR(find_device_opp(dev))) { + dev_warn("%s: opp table already exists\n", __func__); + return -EEXIST; + } + prop = of_find_property(dev->of_node, "operating-points", NULL); if (!prop) return -ENODEV;