No subject
Wed Jun 1 12:03:18 EDT 2011
a static array of one or two entries; min & max baud are always set to
0, and names are one of:
- uclk & pclk
- uclk
- uclk1
- fclk (with divisor either 10 or 0)
- pclk_low & uclk1
You could also make the clock structure a static array of 2 elements
in the private data structure. That would simplify both this code and
the followon DT patch.
Also, peaking forward at what the 2nd patch does, I think that it
might just be a little premature to try and decode the clock info from
the DT. But I'll address that issue when replying to the second
patch.
> +
> + =A0 =A0 =A0 cfg =3D &info->cfg;
> =A0 =A0 =A0 =A0if (cfg->hwport > CONFIG_SERIAL_SAMSUNG_UARTS) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0printk(KERN_ERR "%s: port %d bigger than %=
d\n", __func__,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 cfg->hwport, CONFIG_SERIAL_SA=
MSUNG_UARTS);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 kfree(info->cfg.clocks);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -ERANGE;
> =A0 =A0 =A0 =A0}
>
> @@ -1181,11 +1195,13 @@ EXPORT_SYMBOL_GPL(s3c24xx_serial_probe);
> =A0int __devexit s3c24xx_serial_remove(struct platform_device *dev)
> =A0{
> =A0 =A0 =A0 =A0struct uart_port *port =3D s3c24xx_dev_to_port(&dev->dev);
> + =A0 =A0 =A0 struct s3c24xx_uart_info *info =3D s3c24xx_port_to_info(por=
t);
>
> =A0 =A0 =A0 =A0if (port) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0s3c24xx_serial_cpufreq_deregister(to_ourpo=
rt(port));
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0device_remove_file(&dev->dev, &dev_attr_cl=
ock_source);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0uart_remove_one_port(&s3c24xx_uart_drv, po=
rt);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 kfree(info->cfg.clocks);
> =A0 =A0 =A0 =A0}
>
> =A0 =A0 =A0 =A0return 0;
> diff --git a/drivers/tty/serial/samsung.h b/drivers/tty/serial/samsung.h
> index a69d9a5..4f2f6f5 100644
> --- a/drivers/tty/serial/samsung.h
> +++ b/drivers/tty/serial/samsung.h
> @@ -24,6 +24,9 @@ struct s3c24xx_uart_info {
>
> =A0 =A0 =A0 =A0unsigned int =A0 =A0 =A0 =A0 =A0 =A0has_divslot:1;
>
> + =A0 =A0 =A0 /* copy of platform data */
I'd change this to "copy of /configuration/ data" since the data
doesn't necessarily come from the platform_data pointer anymore.
> + =A0 =A0 =A0 struct s3c2410_uartcfg =A0cfg;
> +
> =A0 =A0 =A0 =A0/* clock source control */
>
> =A0 =A0 =A0 =A0int (*get_clksrc)(struct uart_port *, struct s3c24xx_uart_=
clksrc *clk);
> @@ -56,7 +59,6 @@ struct s3c24xx_uart_port {
> =A0/* conversion functions */
>
> =A0#define s3c24xx_dev_to_port(__dev) (struct uart_port *)dev_get_drvdata=
(__dev)
> -#define s3c24xx_dev_to_cfg(__dev) (struct s3c2410_uartcfg *)((__dev)->pl=
atform_data)
>
> =A0/* register access controls */
>
> --
> 1.6.6.rc2
>
>
> _______________________________________________
> linaro-dev mailing list
> linaro-dev at lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/linaro-dev
>
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
More information about the linux-arm-kernel
mailing list