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

Samuel Thibault samuel.thibault at ens-lyon.org
Sat Mar 11 21:12:41 EST 2017


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.

> -EXPORT_SYMBOL_GPL(spk_serial_out);



Apart from that, it's clean and nice :)

Samuel


More information about the Speakup mailing list