Re: 8250.nr_uarts broken in 3.7

Jiri Slaby
2013-03-08T23:10:18Z

On 03/08/2013 11:58 PM, Jiri Slaby wrote:
> On 03/08/2013 11:49 PM, Josh Boyer wrote:
>> On Fri, Mar 08, 2013 at 11:47:01PM +0100, Jiri Slaby wrote:
>>> Yeah, I agree this is ugly. Just re-definining MODULE_PARAM_PREFIX at
>>> the end of the file should do the trick (followed by
>>> "module_param(nr_uarts, uint, 0644)").
>>
>> For some reason, I thought I had tried that. Maybe I didn't. I'll look
>> into it again.
>
> I see. Because we would re-define some global variables. What if we put
> module_param into a function?

Something like this?
#ifdef MODULE
static void __unused splat(void) {
# undef MODULE_PARAM_PREFIX
# define MODULE_PARAM_PREFIX "8250."
module_param_cb(nr_uarts, &param_ops_uint, &nr_uarts, 0644);
...
}
#endif

Not nice, but should work. The other way is to have those in a separate
file linked to 8250 (to avoid re-definition errors).

thanks,
--
js
suse labs