Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755278Ab1CYWxv (ORCPT ); Fri, 25 Mar 2011 18:53:51 -0400 Received: from moutng.kundenserver.de ([212.227.126.186]:61162 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751392Ab1CYWxu (ORCPT ); Fri, 25 Mar 2011 18:53:50 -0400 From: Arnd Bergmann To: Mike Frysinger Subject: Re: [RFC PATCHv2 1/4] drivers/otp: add initial support for OTP memory Date: Fri, 25 Mar 2011 23:53:42 +0100 User-Agent: KMail/1.13.5 (Linux/2.6.38+; KDE/4.5.1; x86_64; ; ) Cc: Jamie Iles , linux-kernel@vger.kernel.org, gregkh@suse.de References: <1300980071-24645-1-git-send-email-jamie@jamieiles.com> <201103252335.14676.arnd@arndb.de> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201103252353.42901.arnd@arndb.de> X-Provags-ID: V02:K0:HpNhdw9mGoG4gWROpa0MPc5MtXsm4J9QkhRidFbjARZ WUJleLTtoiGnoxnbgS58RZxNIlioalK+GTSRmD8E8Zb9oeiAWZ K+S+brhB8/GwdBim/Ebu10w6+ylvNOFep6uoYipr2xRFgwW97W 3SNK1YEOQPp0q4dJtP5rz8syF+2IXXZnUbEk0R+/dvnCPZA0UK KVUMyfk+zIF0rxznL9Gbw== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1613 Lines: 34 On Friday 25 March 2011 23:38:00 Mike Frysinger wrote: > On Fri, Mar 25, 2011 at 18:35, Arnd Bergmann wrote: > > One more thing that I just realized: > > I think it would be better not to allow arbitrary ioctl commands to > > be interpreted by the individual drivers. Instead, interpret them > > in the common code and pass the data to the drivers through separate > > otp_device_ops function pointers, one per ioctl command. > > > > This will reduce the amount of code needed in each driver when you > > have multiple ones implementing the same ioctls, and help to > > ensure that they all treat the arguments in the same way. > > i think we should do what the rtc framework did ... there are common > ioctls which call specific function pointers in the driver, and any > unhandled ioctls get passed to the driver-specific ioctl function. > this should cover everyone's needs. It depends on how obscure the ioctls get, but I think the first attempt should always be to standardize them across the subsystem. A lot of things are wrong with the whole concept, but when they are needed, you should at least try to shield individual drivers from them. Many subsystems end up needing both common and driver specific ioctls as they grow, I just wouldn't do that to start out with. There's always hope that the latest subsystem will be better than the others ;-). Arnd -- 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/