Skip to content

Commit b4619d8

Browse files
committed
phy: apple: atc: Remove "new" but never used tunable format
This format with 64-bit values was not necessary and ended up never been used. Remove it to avoid possible mixups. This code will be soon replaced anyway. Signed-off-by: Janne Grunau <j@jannau.net>
1 parent bac7b12 commit b4619d8

1 file changed

Lines changed: 1 addition & 78 deletions

File tree

drivers/phy/apple/atc.c

Lines changed: 1 addition & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -2177,11 +2177,6 @@ static int atcphy_parse_legacy_tunable(struct apple_atcphy *atcphy,
21772177
const __le32 *p = NULL;
21782178
int i;
21792179

2180-
#if 0
2181-
WARN_TAINT_ONCE(1, TAINT_FIRMWARE_WORKAROUND,
2182-
"parsing legacy tunable; please update m1n1");
2183-
#endif
2184-
21852180
prop = of_find_property(atcphy->np, name, NULL);
21862181
if (!prop) {
21872182
dev_err(atcphy->dev, "tunable %s not found\n", name);
@@ -2208,88 +2203,16 @@ static int atcphy_parse_legacy_tunable(struct apple_atcphy *atcphy,
22082203
return 0;
22092204
}
22102205

2211-
static int atcphy_parse_new_tunable(struct apple_atcphy *atcphy,
2212-
struct atcphy_tunable *tunable,
2213-
const char *name)
2214-
{
2215-
struct property *prop;
2216-
u64 *fdt_tunable;
2217-
int ret, i;
2218-
2219-
prop = of_find_property(atcphy->np, name, NULL);
2220-
if (!prop) {
2221-
dev_err(atcphy->dev, "tunable %s not found\n", name);
2222-
return -ENOENT;
2223-
}
2224-
2225-
if (prop->length % (4 * sizeof(u64)))
2226-
return -EINVAL;
2227-
2228-
fdt_tunable = kzalloc(prop->length, GFP_KERNEL);
2229-
if (!fdt_tunable)
2230-
return -ENOMEM;
2231-
2232-
tunable->sz = prop->length / (4 * sizeof(u64));
2233-
ret = of_property_read_variable_u64_array(atcphy->np, name, fdt_tunable,
2234-
tunable->sz, tunable->sz);
2235-
if (ret < 0)
2236-
goto err_free_fdt;
2237-
2238-
tunable->values = devm_kcalloc(atcphy->dev, tunable->sz,
2239-
sizeof(*tunable->values), GFP_KERNEL);
2240-
if (!tunable->values) {
2241-
ret = -ENOMEM;
2242-
goto err_free_fdt;
2243-
}
2244-
2245-
for (i = 0; i < tunable->sz; ++i) {
2246-
u32 offset, size, mask, value;
2247-
2248-
offset = fdt_tunable[4 * i];
2249-
size = fdt_tunable[4 * i + 1];
2250-
mask = fdt_tunable[4 * i + 2];
2251-
value = fdt_tunable[4 * i + 3];
2252-
2253-
if (offset > U32_MAX || size != 4 || mask > U32_MAX ||
2254-
value > U32_MAX) {
2255-
ret = -EINVAL;
2256-
goto err_free_values;
2257-
}
2258-
2259-
tunable->values[i].offset = offset;
2260-
tunable->values[i].mask = mask;
2261-
tunable->values[i].value = value;
2262-
}
2263-
2264-
trace_atcphy_parsed_tunable(name, tunable);
2265-
kfree(fdt_tunable);
2266-
2267-
BUG_ON(1);
2268-
return 0;
2269-
2270-
err_free_values:
2271-
devm_kfree(atcphy->dev, tunable->values);
2272-
err_free_fdt:
2273-
kfree(fdt_tunable);
2274-
return ret;
2275-
}
2276-
22772206
static int atcphy_parse_tunable(struct apple_atcphy *atcphy,
22782207
struct atcphy_tunable *tunable,
22792208
const char *name)
22802209
{
2281-
int ret;
2282-
22832210
if (!of_find_property(atcphy->np, name, NULL)) {
22842211
dev_err(atcphy->dev, "tunable %s not found\n", name);
22852212
return -ENOENT;
22862213
}
22872214

2288-
ret = atcphy_parse_new_tunable(atcphy, tunable, name);
2289-
if (ret)
2290-
ret = atcphy_parse_legacy_tunable(atcphy, tunable, name);
2291-
2292-
return ret;
2215+
return atcphy_parse_legacy_tunable(atcphy, tunable, name);
22932216
}
22942217

22952218
static int atcphy_load_tunables(struct apple_atcphy *atcphy)

0 commit comments

Comments
 (0)