Re: [PATCH][2.6.10-rc2-mm4] perfctr sysfs update 1/4: core
From: Greg KH
Date: Thu Dec 02 2004 - 14:02:35 EST
On Thu, Dec 02, 2004 at 11:10:24AM +0100, Mikael Pettersson wrote:
> +static int __init perfctr_class_init(void)
> +{
> + int ret;
> +
> + ret = class_register(&perfctr_class);
> + if (ret)
> + return ret;
> + ret |= class_create_file(&perfctr_class, &class_attr_driver_version);
> + ret |= class_create_file(&perfctr_class, &class_attr_cpu_type);
> + ret |= class_create_file(&perfctr_class, &class_attr_cpu_features);
> + ret |= class_create_file(&perfctr_class, &class_attr_cpu_khz);
> + ret |= class_create_file(&perfctr_class, &class_attr_tsc_to_cpu_mult);
> + ret |= class_create_file(&perfctr_class, &class_attr_cpus_online);
> + ret |= class_create_file(&perfctr_class, &class_attr_cpus_forbidden);
> + if (ret)
> + class_unregister(&perfctr_class);
> + return ret;
It's easier to use sysfs_create_group() instead of registering all of
the individual files.
thanks,
greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/