[PATCH v2 02/15] platform/surface: aggregator: Add platform handler pointer to device

Mario Limonciello posted 15 patches 4 weeks ago
There is a newer version of this series
[PATCH v2 02/15] platform/surface: aggregator: Add platform handler pointer to device
Posted by Mario Limonciello 4 weeks ago
To be able to reference the platform handler in remove, add
a pointer to `struct ssam_device`.

Tested-by: Matthew Schwartz <matthew.schwartz@linux.dev>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
v2:
 * Use ssam_device_set_drvdata()
---
 drivers/platform/surface/surface_platform_profile.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/platform/surface/surface_platform_profile.c b/drivers/platform/surface/surface_platform_profile.c
index 61aa488a80eb5..a18eb93eebb92 100644
--- a/drivers/platform/surface/surface_platform_profile.c
+++ b/drivers/platform/surface/surface_platform_profile.c
@@ -210,6 +210,7 @@ static int surface_platform_profile_probe(struct ssam_device *sdev)
 		return -ENOMEM;
 
 	tpd->sdev = sdev;
+	ssam_device_set_drvdata(sdev, tpd);
 
 	tpd->handler.name = "Surface Platform Profile";
 	tpd->handler.profile_get = ssam_platform_profile_get;
-- 
2.43.0
Re: [PATCH v2 02/15] platform/surface: aggregator: Add platform handler pointer to device
Posted by Maximilian Luz 3 weeks, 6 days ago
On 10/28/24 3:01 AM, Mario Limonciello wrote:
> To be able to reference the platform handler in remove, add
> a pointer to `struct ssam_device`.
> 
> Tested-by: Matthew Schwartz <matthew.schwartz@linux.dev>
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
> v2:
>   * Use ssam_device_set_drvdata()
> ---
>   drivers/platform/surface/surface_platform_profile.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/platform/surface/surface_platform_profile.c b/drivers/platform/surface/surface_platform_profile.c
> index 61aa488a80eb5..a18eb93eebb92 100644
> --- a/drivers/platform/surface/surface_platform_profile.c
> +++ b/drivers/platform/surface/surface_platform_profile.c
> @@ -210,6 +210,7 @@ static int surface_platform_profile_probe(struct ssam_device *sdev)
>   		return -ENOMEM;
>   
>   	tpd->sdev = sdev;
> +	ssam_device_set_drvdata(sdev, tpd);
>   
>   	tpd->handler.name = "Surface Platform Profile";
>   	tpd->handler.profile_get = ssam_platform_profile_get;

Looks good to me now, thanks!

Maybe this could/should be squashed into patch 03 now that it's just a
one-line change, but I'll leave that decision to Hans or Ilpo.

Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com>
Re: [PATCH v2 02/15] platform/surface: aggregator: Add platform handler pointer to device
Posted by Mario Limonciello 3 weeks, 6 days ago
On 10/28/2024 12:30, Maximilian Luz wrote:
> On 10/28/24 3:01 AM, Mario Limonciello wrote:
>> To be able to reference the platform handler in remove, add
>> a pointer to `struct ssam_device`.
>>
>> Tested-by: Matthew Schwartz <matthew.schwartz@linux.dev>
>> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
>> ---
>> v2:
>>   * Use ssam_device_set_drvdata()
>> ---
>>   drivers/platform/surface/surface_platform_profile.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/platform/surface/surface_platform_profile.c b/ 
>> drivers/platform/surface/surface_platform_profile.c
>> index 61aa488a80eb5..a18eb93eebb92 100644
>> --- a/drivers/platform/surface/surface_platform_profile.c
>> +++ b/drivers/platform/surface/surface_platform_profile.c
>> @@ -210,6 +210,7 @@ static int surface_platform_profile_probe(struct 
>> ssam_device *sdev)
>>           return -ENOMEM;
>>       tpd->sdev = sdev;
>> +    ssam_device_set_drvdata(sdev, tpd);
>>       tpd->handler.name = "Surface Platform Profile";
>>       tpd->handler.profile_get = ssam_platform_profile_get;
> 
> Looks good to me now, thanks!
> 
> Maybe this could/should be squashed into patch 03 now that it's just a
> one-line change, but I'll leave that decision to Hans or Ilpo.
> 
> Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com>

Oh yeah; totally makes sense to squash now.  I'll merge the two patches 
for the next go around and pick up your tag.