Skip to content

Commit 89256d7

Browse files
geertuglaubitz
authored andcommitted
sh: dma: Remove unused functionality
dma_extend(), get_dma_info_by_name(), register_chan_caps(), and request_dma_bycap() are unused. Remove them, and all related code. Signed-off-by: Geert Uytterhoeven <[email protected]> Reviewed-by: John Paul Adrian Glaubitz <[email protected]> Link: https://lore.kernel.org/r/2beb81fdd7592a94329e3c9a6ba56959f6094019.1709326528.git.geert+renesas@glider.be Signed-off-by: John Paul Adrian Glaubitz <[email protected]>
1 parent 106398f commit 89256d7

File tree

2 files changed

+0
-123
lines changed

2 files changed

+0
-123
lines changed

arch/sh/drivers/dma/dma-api.c

Lines changed: 0 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,6 @@ struct dma_info *get_dma_info(unsigned int chan)
4141
}
4242
EXPORT_SYMBOL(get_dma_info);
4343

44-
struct dma_info *get_dma_info_by_name(const char *dmac_name)
45-
{
46-
struct dma_info *info;
47-
48-
list_for_each_entry(info, &registered_dmac_list, list) {
49-
if (dmac_name && (strcmp(dmac_name, info->name) != 0))
50-
continue;
51-
else
52-
return info;
53-
}
54-
55-
return NULL;
56-
}
57-
EXPORT_SYMBOL(get_dma_info_by_name);
58-
5944
static unsigned int get_nr_channels(void)
6045
{
6146
struct dma_info *info;
@@ -101,66 +86,6 @@ int get_dma_residue(unsigned int chan)
10186
}
10287
EXPORT_SYMBOL(get_dma_residue);
10388

104-
static int search_cap(const char **haystack, const char *needle)
105-
{
106-
const char **p;
107-
108-
for (p = haystack; *p; p++)
109-
if (strcmp(*p, needle) == 0)
110-
return 1;
111-
112-
return 0;
113-
}
114-
115-
/**
116-
* request_dma_bycap - Allocate a DMA channel based on its capabilities
117-
* @dmac: List of DMA controllers to search
118-
* @caps: List of capabilities
119-
*
120-
* Search all channels of all DMA controllers to find a channel which
121-
* matches the requested capabilities. The result is the channel
122-
* number if a match is found, or %-ENODEV if no match is found.
123-
*
124-
* Note that not all DMA controllers export capabilities, in which
125-
* case they can never be allocated using this API, and so
126-
* request_dma() must be used specifying the channel number.
127-
*/
128-
int request_dma_bycap(const char **dmac, const char **caps, const char *dev_id)
129-
{
130-
unsigned int found = 0;
131-
struct dma_info *info;
132-
const char **p;
133-
int i;
134-
135-
BUG_ON(!dmac || !caps);
136-
137-
list_for_each_entry(info, &registered_dmac_list, list)
138-
if (strcmp(*dmac, info->name) == 0) {
139-
found = 1;
140-
break;
141-
}
142-
143-
if (!found)
144-
return -ENODEV;
145-
146-
for (i = 0; i < info->nr_channels; i++) {
147-
struct dma_channel *channel = &info->channels[i];
148-
149-
if (unlikely(!channel->caps))
150-
continue;
151-
152-
for (p = caps; *p; p++) {
153-
if (!search_cap(channel->caps, *p))
154-
break;
155-
if (request_dma(channel->chan, dev_id) == 0)
156-
return channel->chan;
157-
}
158-
}
159-
160-
return -EINVAL;
161-
}
162-
EXPORT_SYMBOL(request_dma_bycap);
163-
16489
int request_dma(unsigned int chan, const char *dev_id)
16590
{
16691
struct dma_channel *channel = { 0 };
@@ -213,35 +138,6 @@ void dma_wait_for_completion(unsigned int chan)
213138
}
214139
EXPORT_SYMBOL(dma_wait_for_completion);
215140

216-
int register_chan_caps(const char *dmac, struct dma_chan_caps *caps)
217-
{
218-
struct dma_info *info;
219-
unsigned int found = 0;
220-
int i;
221-
222-
list_for_each_entry(info, &registered_dmac_list, list)
223-
if (strcmp(dmac, info->name) == 0) {
224-
found = 1;
225-
break;
226-
}
227-
228-
if (unlikely(!found))
229-
return -ENODEV;
230-
231-
for (i = 0; i < info->nr_channels; i++, caps++) {
232-
struct dma_channel *channel;
233-
234-
if ((info->first_channel_nr + i) != caps->ch_num)
235-
return -EINVAL;
236-
237-
channel = &info->channels[i];
238-
channel->caps = caps->caplist;
239-
}
240-
241-
return 0;
242-
}
243-
EXPORT_SYMBOL(register_chan_caps);
244-
245141
void dma_configure_channel(unsigned int chan, unsigned long flags)
246142
{
247143
struct dma_info *info = get_dma_info(chan);
@@ -267,18 +163,6 @@ int dma_xfer(unsigned int chan, unsigned long from,
267163
}
268164
EXPORT_SYMBOL(dma_xfer);
269165

270-
int dma_extend(unsigned int chan, unsigned long op, void *param)
271-
{
272-
struct dma_info *info = get_dma_info(chan);
273-
struct dma_channel *channel = get_dma_channel(chan);
274-
275-
if (info->ops->extend)
276-
return info->ops->extend(channel, op, param);
277-
278-
return -ENOSYS;
279-
}
280-
EXPORT_SYMBOL(dma_extend);
281-
282166
static int dma_proc_show(struct seq_file *m, void *v)
283167
{
284168
struct dma_info *info = v;

arch/sh/include/asm/dma.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ struct dma_ops {
5656
int (*get_residue)(struct dma_channel *chan);
5757
int (*xfer)(struct dma_channel *chan);
5858
int (*configure)(struct dma_channel *chan, unsigned long flags);
59-
int (*extend)(struct dma_channel *chan, unsigned long op, void *param);
6059
};
6160

6261
struct dma_channel {
@@ -118,8 +117,6 @@ extern int dma_xfer(unsigned int chan, unsigned long from,
118117
#define dma_read_page(chan, from, to) \
119118
dma_read(chan, from, to, PAGE_SIZE)
120119

121-
extern int request_dma_bycap(const char **dmac, const char **caps,
122-
const char *dev_id);
123120
extern int get_dma_residue(unsigned int chan);
124121
extern struct dma_info *get_dma_info(unsigned int chan);
125122
extern struct dma_channel *get_dma_channel(unsigned int chan);
@@ -128,10 +125,6 @@ extern void dma_configure_channel(unsigned int chan, unsigned long flags);
128125

129126
extern int register_dmac(struct dma_info *info);
130127
extern void unregister_dmac(struct dma_info *info);
131-
extern struct dma_info *get_dma_info_by_name(const char *dmac_name);
132-
133-
extern int dma_extend(unsigned int chan, unsigned long op, void *param);
134-
extern int register_chan_caps(const char *dmac, struct dma_chan_caps *capslist);
135128

136129
/* arch/sh/drivers/dma/dma-sysfs.c */
137130
extern int dma_create_sysfs_files(struct dma_channel *, struct dma_info *);

0 commit comments

Comments
 (0)