From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Petazzoni Subject: Re: [RFC] [PATCH v3 2/4] OMAP4: Keyboard device registration Date: Wed, 2 Jun 2010 10:28:13 +0200 Message-ID: <20100602102813.59519b77@surf> References: <27F9C60D11D683428E133F85D2BB4A53043E537F74@dlee03.ent.ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Return-path: Received: from mail.free-electrons.com ([88.191.76.200]:56896 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752388Ab0FBIfK (ORCPT ); Wed, 2 Jun 2010 04:35:10 -0400 In-Reply-To: <27F9C60D11D683428E133F85D2BB4A53043E537F74@dlee03.ent.ti.com> Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org To: "Arce, Abraham" Cc: "linux-input@vger.kernel.org" , "linux-omap@vger.kernel.org" , "dmitry.torokhov@gmail.com" On Mon, 31 May 2010 16:44:52 -0500 "Arce, Abraham" wrote: > + unsigned int length = 0, id = 0; > + int hw_mod_name_len = 16; > + char oh_name[hw_mod_name_len]; > + char *name = "omap4-keypad"; > + > + length = snprintf(oh_name, hw_mod_name_len, "kbd"); > + > + oh = omap_hwmod_lookup(oh_name); > + if (!oh) { > + pr_err("Could not look up %s\n", oh_name); > + return -EIO; > + } Maybe I'm missing something here, but I don't see where "length" is being used, and why the snprintf()/oh_name thing is needed. What about: unsigned int id = 0; char *name = "omap4-keypad"; oh = omap_hwmod_lookup("kbd"); if (!oh) { pr_err("Could not look up kbd\n"); return -EIO; } Thomas -- Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com