Thread (19 messages) 19 messages, 5 authors, 2009-09-17

Re: [PATCH 5/5] kernel handling of CPU DLPAR

flat view

From: Brian King <hidden>
Date: 2009-09-15 14:49:01
Also in: lkml

Nathan Fontenot wrote:
quoted hunk ↗ jump to hunk
+static ssize_t cpu_probe_store(struct class *class, const char *buf,
+                   size_t count)
+{
+    struct device_node *dn;
+    u32 drc_index;
+    char *cpu_name;
+    int rc;
+
+    drc_index = simple_strtoull(buf, NULL, 0);
Can just use simple_strtoul here instead.
quoted hunk ↗ jump to hunk
+    if (!drc_index)
+        return -EINVAL;
+
+    rc = acquire_drc(drc_index);
+    if (rc)
+        return rc;
+
+    dn = configure_connector(drc_index);
+    if (!dn) {
+        release_drc(drc_index);
+        return rc;
+    }
+
+    /* fixup dn name */
+    cpu_name = kzalloc(strlen(dn->full_name) + strlen("/cpus/") + 1,
+               GFP_KERNEL);
+    sprintf(cpu_name, "/cpus/%s", dn->full_name);
+    kfree(dn->full_name);
+    dn->full_name = cpu_name;
+
+    rc = add_device_tree_nodes(dn);
+    if (rc)
+        release_drc(drc_index);
+
+    return rc ? rc : count;
+}
+

-- 
Brian King
Linux on Power Virtualization
IBM Linux Technology Center
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help