Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[firefly-linux-kernel-4.4.55.git] / drivers / bus / arm-cci.c
index 860da40b78effb96b16a779f84f9ea21d05aba95..84fd66057dadf9e60b6c9ad04e535334265cda01 100644 (file)
@@ -806,8 +806,8 @@ static int cci_pmu_event_init(struct perf_event *event)
 static ssize_t pmu_attr_cpumask_show(struct device *dev,
                                     struct device_attribute *attr, char *buf)
 {
-       int n = cpulist_scnprintf(buf, PAGE_SIZE - 2, &pmu->cpus);
-
+       int n = scnprintf(buf, PAGE_SIZE - 1, "%*pbl",
+                         cpumask_pr_args(&pmu->cpus));
        buf[n++] = '\n';
        buf[n] = '\0';
        return n;
@@ -1312,6 +1312,9 @@ static int cci_probe(void)
        if (!np)
                return -ENODEV;
 
+       if (!of_device_is_available(np))
+               return -ENODEV;
+
        cci_config = of_match_node(arm_cci_matches, np)->data;
        if (!cci_config)
                return -ENODEV;