cpufreq: acpi-cpufreq: Fix up the handling of cpb sysfs attribute
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 22 Jul 2015 20:12:10 +0000 (22:12 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 22 Jul 2015 20:12:10 +0000 (22:12 +0200)
commitf56c50e322eed07526a08edefa29fc8bab1e93df
tree30a62b866c66966abf225fe58fc3eb19b02d661b
parent3427616b2a5aa7f34716278aa6a140378a00a36e
cpufreq: acpi-cpufreq: Fix up the handling of cpb sysfs attribute

The cpb sysfs attribute is only exposed by the ACPI cpufreq driver
after a runtime check.  For this purpose, the driver keeps a NULL
placeholder in its table of sysfs attributes and replaces the NULL
with a pointer to an attribute structure if it decides to expose
cpb.

That is confusing, so make the driver set the pointer to the cpb
attribute structure upfront and replace it with NULL if the
attribute should not be exposed instead.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/acpi-cpufreq.c