In the attached patch, I noticed in this function:<br><br><pre>+static ssize_t set_usb_mode(struct device *dev, struct device_attribute *attr,<br>+                            const char *buf, size_t count)<br>+{<br>+        if (!strncmp(buf, &quot;host&quot;, 4)) {
<br>+                printk(&quot;s3c2410: changing usb to host\n&quot;);<br>+                s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST,<br>+                                      S3C2410_MISCCR_USBHOST);<br>+                /* FIXME: <br>+                 * - call machine-specific disable-pullup function i
<br>+                 * - enable +Vbus (if hardware supports it)<br>+                 */<br>+                s3c2410_gpio_setpin(S3C2410_GPE5, 0);<br>+        } else if (!strncmp(buf, &quot;device&quot;, 6)) {<br>+                printk(&quot;s3c2410: changing usb to device\n&quot;);
<br>+                s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST, 0);<br>+                s3c2410_gpio_setpin(S3C2410_GPE5, 1);<br>+        } else<br>+                printk(&quot;s3c2410: unknown mode\n&quot;);<br>+                return -EINVAL;<br>+        return count;<br>+}</pre>Didn&#39;t you want to put {} around the else? -EINVAL is only returned if the mode is incorrect :
<br><pre>+        } else {<br>+                printk(&quot;s3c2410: unknown mode\n&quot;);<br>+                return -EINVAL;<br>+        }<br>+        return count;<br></pre>
<br><br><div><span class="gmail_quote">2007/9/17, <a href="mailto:bugzilla-daemon@bugzilla.openmoko.org">bugzilla-daemon@bugzilla.openmoko.org</a> &lt;<a href="mailto:bugzilla-daemon@bugzilla.openmoko.org">bugzilla-daemon@bugzilla.openmoko.org
</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><a href="http://bugzilla.openmoko.org/cgi-bin/bugzilla/show_bug.cgi?id=876">
http://bugzilla.openmoko.org/cgi-bin/bugzilla/show_bug.cgi?id=876</a><br><br><br><br><br><br>------- Additional Comments From <a href="mailto:zeroping@gmail.com">zeroping@gmail.com</a>&nbsp;&nbsp;2007-09-17 20:53 -------<br>Created an attachment (id=312)
<br> --&gt; (<a href="http://bugzilla.openmoko.org/cgi-bin/bugzilla/attachment.cgi?id=312&amp;action=view">http://bugzilla.openmoko.org/cgi-bin/bugzilla/attachment.cgi?id=312&amp;action=view</a>)<br>The updated usb mode switching patch
<br><br><br><br><br>------- You are receiving this mail because: -------<br>You are on the CC list for the bug, or are watching someone who is.<br><br>_______________________________________________<br>buglog mailing list
<br><a href="mailto:buglog@lists.openmoko.org">buglog@lists.openmoko.org</a><br><a href="http://lists.openmoko.org/mailman/listinfo/buglog">http://lists.openmoko.org/mailman/listinfo/buglog</a><br></blockquote></div><br><br clear="all">
<br>-- <br>Sébastien LORQUET - 이세영 (李世榮)<br>Ingénieur ENSPG 2006 / ENSIMAG-ASI 2007