File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ struct spi_offload *devm_spi_offload_get(struct device *dev,
108
108
const struct spi_offload_config * config )
109
109
{
110
110
struct spi_controller_and_offload * resource ;
111
+ struct spi_offload * offload ;
111
112
int ret ;
112
113
113
114
if (!spi || !config )
@@ -120,18 +121,20 @@ struct spi_offload *devm_spi_offload_get(struct device *dev,
120
121
if (!resource )
121
122
return ERR_PTR (- ENOMEM );
122
123
123
- resource -> controller = spi -> controller ;
124
- resource -> offload = spi -> controller -> get_offload (spi , config );
125
- if (IS_ERR (resource -> offload )) {
124
+ offload = spi -> controller -> get_offload (spi , config );
125
+ if (IS_ERR (offload )) {
126
126
kfree (resource );
127
- return resource -> offload ;
127
+ return offload ;
128
128
}
129
129
130
+ resource -> controller = spi -> controller ;
131
+ resource -> offload = offload ;
132
+
130
133
ret = devm_add_action_or_reset (dev , spi_offload_put , resource );
131
134
if (ret )
132
135
return ERR_PTR (ret );
133
136
134
- return resource -> offload ;
137
+ return offload ;
135
138
}
136
139
EXPORT_SYMBOL_GPL (devm_spi_offload_get );
137
140
You can’t perform that action at this time.
0 commit comments