1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>platform_device_register_simple</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Device Drivers"><link rel="up" href="ch02s02.html" title="Device Drivers Base"><link rel="prev" href="API-platform-device-register-resndata.html" title="platform_device_register_resndata"><link rel="next" href="API-platform-device-register-data.html" title="platform_device_register_data"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">platform_device_register_simple</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-platform-device-register-resndata.html">Prev</a>&#160;</td><th width="60%" align="center">Device Drivers Base</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-platform-device-register-data.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-platform-device-register-simple"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>platform_device_register_simple &#8212; 
2     add a platform-level device and its resources
3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">struct platform_device * <b class="fsfunc">platform_device_register_simple </b>(</code></td><td>const char * <var class="pdparam">name</var>, </td></tr><tr><td>&#160;</td><td>int <var class="pdparam">id</var>, </td></tr><tr><td>&#160;</td><td>const struct resource * <var class="pdparam">res</var>, </td></tr><tr><td>&#160;</td><td>unsigned int <var class="pdparam">num</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1109817500"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>name</code></em></span></dt><dd><p>
4     base name of the device we're adding
5    </p></dd><dt><span class="term"><em class="parameter"><code>id</code></em></span></dt><dd><p>
6     instance id
7    </p></dd><dt><span class="term"><em class="parameter"><code>res</code></em></span></dt><dd><p>
8     set of resources that needs to be allocated for the device
9    </p></dd><dt><span class="term"><em class="parameter"><code>num</code></em></span></dt><dd><p>
10     number of resources
11    </p></dd></dl></div></div><div class="refsect1"><a name="idp1109822188"></a><h2>Description</h2><p>
12   This function creates a simple platform device that requires minimal
13   resource and memory management. Canned release function freeing memory
14   allocated for the device allows drivers using such devices to be
15   unloaded without waiting for the last reference to the device to be
16   dropped.
17   </p><p>
18
19   This interface is primarily intended for use with legacy drivers which
20   probe hardware directly.  Because such drivers create sysfs device nodes
21   themselves, rather than letting system infrastructure handle such device
22   enumeration tasks, they don't fully conform to the Linux driver model.
23   In particular, when such drivers are built as modules, they can't be
24   <span class="quote">&#8220;<span class="quote">hotplugged</span>&#8221;</span>.
25   </p><p>
26
27   Returns <span class="structname">struct platform_device</span> pointer on success, or <code class="function">ERR_PTR</code> on error.
28</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-platform-device-register-resndata.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="ch02s02.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-platform-device-register-data.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">platform_device_register_resndata</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span class="phrase">platform_device_register_data</span></td></tr></table></div></body></html>
29