From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751747AbbCGPBG (ORCPT ); Sat, 7 Mar 2015 10:01:06 -0500 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:56344 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750931AbbCGPBA (ORCPT ); Sat, 7 Mar 2015 10:01:00 -0500 Date: Sat, 7 Mar 2015 15:00:35 +0000 From: Mark Brown To: Srinivas Kandagatla Cc: linux-arm-kernel@lists.infradead.org, Maxime Ripard , Rob Herring , Pawel Moll , Kumar Gala , linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Stephen Boyd , andrew@lunn.ch, Arnd Bergmann , Greg Kroah-Hartman Message-ID: <20150307150035.GN28806@sirena.org.uk> References: <1425548685-12887-1-git-send-email-srinivas.kandagatla@linaro.org> <1425548741-12930-1-git-send-email-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lBqJz4CGKwlWe7/k" Content-Disposition: inline In-Reply-To: <1425548741-12930-1-git-send-email-srinivas.kandagatla@linaro.org> X-Cookie: Editing is a rewording activity. User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH v1 1/6] eeprom: Add a simple EEPROM framework for eeprom providers X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --lBqJz4CGKwlWe7/k Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Mar 05, 2015 at 09:45:41AM +0000, Srinivas Kandagatla wrote: > + > + return eeprom; > +} > +EXPORT_SYMBOL(eeprom_register); This framework uses regmap but regmap is EXPORT_SYMBOL_GPL() and this is using EXPORT_SYMBOL(). > +int eeprom_unregister(struct eeprom_device *eeprom) > +{ > + mutex_lock(&eeprom_mutex); > + if (atomic_read(&eeprom->users)) { > + mutex_unlock(&eeprom_mutex); Atomic reads and a mutex - isn't the mutex enough? Atomics are generally a recipie for bugs due to the complexity in using them. --lBqJz4CGKwlWe7/k Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJU+xKSAAoJECTWi3JdVIfQ6DEIAIM/ex0gXG8abz8ogrpOMyNU w14kC3I/qjRowxq6Mm/Ky9YuYzNtUupHSQjmXNyDKZDLQ8DrEvsPh4I2iE1bPm79 1NRA3gUdkR8xEZF+0M66iVIJWrc0M5ko6rZs0AbvzdP0QPLVREJgJsnQ/IwTr/ld CdzD6eWVfJsJF+/RkFEemV0aPN3KVVhniN6hCaur5MNDxpq1T/iLYuLUrE7u4N+P adURgU82o7VrDLZRiM25S4LMsDqQf8sGcA8YByPoMPJiF0JzA2fx7dHYGILGqaqS 3NQIWqtdmVlpPHlSO6ExjPmROHKkRvbD+VndlKaNZFfnzNdn5XohplKZTzRfrdY= =B3YU -----END PGP SIGNATURE----- --lBqJz4CGKwlWe7/k--