Re: [PATCH v2 01/10] PCMCIA/i82092: use dev_<level> instead of printk

From: Dominik Brodowski
Date: Tue Dec 10 2019 - 08:25:45 EST


On Tue, Dec 10, 2019 at 01:49:02PM +0100, Greg Kroah-Hartman wrote:
> > @@ -417,7 +422,9 @@ static int i82092aa_init(struct pcmcia_socket *sock)
> >
> > static int i82092aa_get_status(struct pcmcia_socket *socket, u_int *value)
> > {
> > - unsigned int sock = container_of(socket, struct socket_info, socket)->number;
> > + struct socket_info *sock_info = container_of(socket, struct socket_info,
> > + socket);
> > + unsigned int sock = sock_info->number;
>
>
> This does not look like a printk cleanup :(
>
> > unsigned int status;
> >
> > enter("i82092aa_get_status");
> > @@ -458,7 +465,9 @@ static int i82092aa_get_status(struct pcmcia_socket *socket, u_int *value)
> >
> > static int i82092aa_set_socket(struct pcmcia_socket *socket, socket_state_t *state)
> > {
> > - unsigned int sock = container_of(socket, struct socket_info, socket)->number;
> > + struct socket_info *sock_info = container_of(socket, struct socket_info,
> > + socket);
> > + unsigned int sock = sock_info->number;
>
> Nor does this :(

... regarding _get_socket() you are right, but here it is required for the
printk cleanup -- to be able to use dev_info(), struct device needs to be
made accessible. So this change seems fine to me.

Thanks,
Dominik