From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752541AbbJGLeI (ORCPT ); Wed, 7 Oct 2015 07:34:08 -0400 Received: from pandora.arm.linux.org.uk ([78.32.30.218]:45178 "EHLO pandora.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751987AbbJGLeG (ORCPT ); Wed, 7 Oct 2015 07:34:06 -0400 Date: Wed, 7 Oct 2015 12:33:49 +0100 From: Russell King - ARM Linux To: Srinivas Kandagatla Cc: gregkh@linuxfoundation.org, stefan.wahren@i2se.com, andrew@lunn.ch, s.hauer@pengutronix.de, pantelis.antoniou@konsulko.com, linux-kernel@vger.kernel.org, maitysanchayan@gmail.com, p.zabel@pengutronix.de, maxime.ripard@free-electrons.com, linux-arm-kernel@lists.infradead.org, wxt@rock-chips.com Subject: Re: [PATCH v2 1/3] nvmem: core: make default user binary file root-access only Message-ID: <20151007113349.GJ21513@n2100.arm.linux.org.uk> References: <1444215536-10783-1-git-send-email-srinivas.kandagatla@linaro.org> <1444215647-10836-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: <1444215647-10836-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 On Wed, Oct 07, 2015 at 12:00:47PM +0100, Srinivas Kandagatla wrote: > As required by many providers like at24/at25/mxs-ocotp/qfprom and may be > other providers would want to allow root-only to read the nvmem content. > So making the defaults to be root-only access would address the request > and also provide flexibility to providers to specify there own permissions > on top of the root-only using the perm flag in nvmem_config. > Making this dynamic did cut down lot of static binary attributes in the > code. Check what the lifetime of a struct bin_attribute is before you embed it into any other structure. Sorry, but I think you're going to have to read up on the driver model, sysfs, and kernfs implementations to find out - I don't know the answer to this without doing the same. However, this is basic checking that anyone should do when embedding a structure within another. -- FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net.