RE: [RFC] [PATCH v3 2/4] OMAP4: Keyboard device registration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks Thomas,

> > +	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;
> 	}

I'll remove length variable and keep snprintf, below oh_name -> kbd is used again, this will keep name defined in one single place

	WARN(IS_ERR(od), "Could not build omap_device for %s %s\n",
		name, oh_name);

Best Regards
Abraham
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux