[patch 3/7] staging: serial: add spk_io_ops struct to spk_synth

Okash Khawaja okash.khawaja at gmail.com
Sun Mar 12 05:32:25 EDT 2017


Hi,

On Sun, Mar 12, 2017 at 03:12:41AM +0100, Samuel Thibault wrote:
> okash.khawaja at gmail.com, on sam. 11 mars 2017 13:05:27 +0000, wrote:
> > This patch adds spk_io_ops struct which contain those methods whose job is to
> > +static int spk_serial_out(struct spk_synth *in_synth, const char ch);
> > +struct spk_io_ops serial_io_ops = {
> > +	.synth_out = spk_serial_out,
> > +};
> > +EXPORT_SYMBOL_GPL(serial_io_ops);
> 
> Prefix it with spk_, to avoid naming clashes with other drivers.
> 
> > @@ -130,6 +136,15 @@
> >  	outb(1, speakup_info.port_tts + UART_FCR);	/* Turn FIFO On */
> >  }
> >  
> > +static int spk_serial_out(struct spk_synth *in_synth, const char ch)
> > +{
> > +	if (in_synth->alive && spk_wait_for_xmitr(in_synth)) {
> > +		outb_p(ch, speakup_info.port_tts);
> > +		return 1;
> > +	}
> > +	return 0;
> > +}
> 
> Don't unnecessarily move the code, only drop the export symbol.

Since spk_serial_out is not more exported, I made it static and moved it
closer to other static functions which are all towards the top of the
file. Perhaps I should put this in description?

> 
> > -EXPORT_SYMBOL_GPL(spk_serial_out);
> 
> 
> 
> Apart from that, it's clean and nice :)
> 
> Samuel


More information about the Speakup mailing list