title: What is the possible use of dev_set_drvdata and dev_get_drvdata
body: <p>I just want to know what is the possible use case when we have to use these set and get driver APIs.
  All I get to know that the data is saved, and at a later time we can use data to do something. My question is when we really need to do that?</p>
  <pre class="lang-c prettyprint-override"><code>     /*
        * These exports can't be _GPL due to .h files using this within them, and it
        * might break something that was previously working...
       */
       void *dev_get_drvdata(const struct device *dev)
       {
            if (dev &amp;&amp; dev-&gt;p)
                    return dev-&gt;p-&gt;driver_data;
            return NULL;
       }
       EXPORT_SYMBOL(dev_get_drvdata);
  
       void dev_set_drvdata(struct device *dev, void *data)
       {
          int error;
   
          if (!dev)
                   return;
          if (!dev-&gt;p) {
                   error = device_private_init(dev);
                   if (error)
                           return;
          }
          dev-&gt;p-&gt;driver_data = data;
       }
       EXPORT_SYMBOL(dev_set_drvdata);
  </code></pre>