From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752644AbbG2Fc4 (ORCPT ); Wed, 29 Jul 2015 01:32:56 -0400 Received: from mail-pd0-f176.google.com ([209.85.192.176]:36069 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751387AbbG2Fcy (ORCPT ); Wed, 29 Jul 2015 01:32:54 -0400 Date: Wed, 29 Jul 2015 11:02:48 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: Linux PM list , Linux Kernel Mailing List , Russell King - ARM Linux Subject: Re: [Update 2x][PATCH 7/7] cpufreq: Separate CPU device registration from CPU online Message-ID: <20150729053248.GC21493@linux> References: <7868353.pEStq1MJ2a@vostro.rjw.lan> <1739669.kedIsxdRK2@vostro.rjw.lan> <1702607.RH80fBCN6J@vostro.rjw.lan> <3091538.g8dYBumqSx@vostro.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3091538.g8dYBumqSx@vostro.rjw.lan> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29-07-15, 03:03, Rafael J. Wysocki wrote: > +static int cpufreq_add_dev(struct device *dev, struct subsys_interface *sif) > +{ > + unsigned cpu = dev->id; > + int ret; > + > + dev_dbg(dev, "%s: adding CPU%u\n", __func__, cpu); > + > + if (cpu_online(cpu)) { > + ret = cpufreq_online(cpu); I will do return right here ... > + } else { ... and this else will not be required anymore. > + /* > + * A hotplug notifier will follow and we will handle it as CPU > + * online then. For now, just create the sysfs link, unless > + * there is no policy or the link is already present. > + */ > + struct cpufreq_policy *policy = per_cpu(cpufreq_cpu_data, cpu); > + > + ret = policy && !cpumask_test_and_set_cpu(cpu, policy->real_cpus) > + ? add_cpu_dev_symlink(policy, cpu) : 0; > + } > + > + return ret; > +} Looks good otherwise. Acked-by: Viresh Kumar -- viresh