Thread (32 messages) 32 messages, 10 authors, 2011-03-11

[RFC PATCHv1 1/2] Export SoC info through sysfs

From: Mark Brown <hidden>
Date: 2011-03-09 17:47:52
Also in: linux-arm-msm, linux-omap

On Wed, Mar 09, 2011 at 05:59:20PM +0100, Maxime Coquelin wrote:
+config SYS_SOC
+	bool "Export SoC specific informations"
+	depends on EMBEDDED
+
 endmenu
Would it not be better for this to depend on a symbol that systems can
select when they add useful output?  If there's nothing that generates
information for it on a given platform there's no point in enabling it.
+static ssize_t show_info(struct sysdev_class *class,
+				struct sysdev_class_attribute *attr, char *buf)
+{
+	struct sys_soc_info *si = container_of(attr,
+			struct sys_soc_info, attr);
+
+	if (si->info)
+		return sprintf(buf, "%s\n", si->info);
+	else if (si->get_info)
+		return sprintf(buf, "%s\n", si->get_info(si));
It seems like it'd be easier to pass the output buffer directly to
get_info(), otherwise the get_info() implementation will have to figure
out a buffer to return data from.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help