lkml.org 
[lkml]   [2023]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1 2/3] ASoC: rt5677: Use device_get_match_data()
On Thu, Jun 29, 2023 at 11:56:10AM +0100, Mark Brown wrote:
> On Thu, Jun 29, 2023 at 01:46:02PM +0300, Andy Shevchenko wrote:

...

> > + rt5677->type = (enum rt5677_type)(uintptr_t)device_get_match_data(dev);

> Double casts, always a sign of a successful simplification! :P

Unfortunate of the C language and use of plain numbers when
pointers are required. :-( I feel your pain.

> > + if (rt5677->type == 0)
> > return -EINVAL;
> > - }

I would prefer to see in the ID table something like

.compatible = "foo", .data = &codec[RT5677],

but in this driver it seems it will require quite a refactoring.

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2023-06-29 13:11    [W:0.032 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site