lkml.org 
[lkml]   [2015]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC PATCH 2/3] eeprom: sunxi: Move the SID driver to the eeprom framework
    On Thu, Feb 19, 2015 at 05:08:40PM +0000, Srinivas Kandagatla wrote:
    > +static int sunxi_sid_probe(struct platform_device *pdev)
    > +{
    > + const struct of_device_id *device;
    > + struct eeprom_sid *sid;
    > + struct resource *res;
    > + struct eeprom_device *eeprom;
    > + struct device *dev = &pdev->dev;
    > + int rval;
    > +
    > + sid = devm_kzalloc(dev, sizeof(*sid), GFP_KERNEL);
    > + if (!sid)
    > + return -ENOMEM;
    > +
    > + eeprom = &sid->eeprom;
    ...
    > + rval = eeprom_register(eeprom);
    > + if (rval)
    > + return rval;
    ...
    > +static int sunxi_sid_remove(struct platform_device *pdev)
    > +{
    > + struct eeprom_device *eeprom = platform_get_drvdata(pdev);
    > +
    > + return eeprom_unregister(eeprom);

    As pointed out in the previous patch, this is unsafe as the eeprom
    structure contains a struct device.

    --
    FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
    according to speedtest.net.


    \
     
     \ /
      Last update: 2015-02-20 19:01    [W:4.024 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site