Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755353AbbBTRsC (ORCPT ); Fri, 20 Feb 2015 12:48:02 -0500 Received: from pandora.arm.linux.org.uk ([78.32.30.218]:52904 "EHLO pandora.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754979AbbBTRsA (ORCPT ); Fri, 20 Feb 2015 12:48:00 -0500 Date: Fri, 20 Feb 2015 17:47:50 +0000 From: Russell King - ARM Linux To: Srinivas Kandagatla Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Arnd Bergmann , Pawel Moll , Greg Kroah-Hartman , linux-api@vger.kernel.org, broonie@kernel.org, Stephen Boyd , linux-kernel@vger.kernel.org, Rob Herring , Kumar Gala , Maxime Ripard Subject: Re: [RFC PATCH 2/3] eeprom: sunxi: Move the SID driver to the eeprom framework Message-ID: <20150220174750.GJ8656@n2100.arm.linux.org.uk> References: <1424365639-26634-1-git-send-email-srinivas.kandagatla@linaro.org> <1424365720-26725-1-git-send-email-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1424365720-26725-1-git-send-email-srinivas.kandagatla@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1137 Lines: 37 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/