Skip to content

Commit a33eb6b

Browse files
Jörn EngelJens Axboe
authored andcommitted
Move mtd_bdi_*mappable to mtdcore.c
Removes one .h and one .c file that are never used outside of mtdcore.c. Signed-off-by: Joern Engel <joern@logfs.org> Edited to remove on leftover debug define. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
1 parent e6d086d commit a33eb6b

4 files changed

Lines changed: 33 additions & 62 deletions

File tree

‎drivers/mtd/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Core functionality.
66
obj-$(CONFIG_MTD) += mtd.o
7-
mtd-y := mtdcore.o mtdsuper.o mtdbdi.o
7+
mtd-y := mtdcore.o mtdsuper.o
88
mtd-$(CONFIG_MTD_PARTITIONS) += mtdpart.o
99

1010
obj-$(CONFIG_MTD_CONCAT) += mtdconcat.o

‎drivers/mtd/internal.h‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +0,0 @@
1-
/* Internal MTD definitions
2-
*
3-
* Copyright © 2006 Red Hat, Inc. All Rights Reserved.
4-
* Written by David Howells (dhowells@redhat.com)
5-
*
6-
* This program is free software; you can redistribute it and/or
7-
* modify it under the terms of the GNU General Public License
8-
* as published by the Free Software Foundation; either version
9-
* 2 of the License, or (at your option) any later version.
10-
*/
11-
12-
/*
13-
* mtdbdi.c
14-
*/
15-
extern struct backing_dev_info mtd_bdi_unmappable;
16-
extern struct backing_dev_info mtd_bdi_ro_mappable;
17-
extern struct backing_dev_info mtd_bdi_rw_mappable;

‎drivers/mtd/mtdbdi.c‎

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +0,0 @@
1-
/* MTD backing device capabilities
2-
*
3-
* Copyright © 2006 Red Hat, Inc. All Rights Reserved.
4-
* Written by David Howells (dhowells@redhat.com)
5-
*
6-
* This program is free software; you can redistribute it and/or
7-
* modify it under the terms of the GNU General Public License
8-
* as published by the Free Software Foundation; either version
9-
* 2 of the License, or (at your option) any later version.
10-
*/
11-
12-
#include <linux/backing-dev.h>
13-
#include <linux/mtd/mtd.h>
14-
#include "internal.h"
15-
16-
/*
17-
* backing device capabilities for non-mappable devices (such as NAND flash)
18-
* - permits private mappings, copies are taken of the data
19-
*/
20-
struct backing_dev_info mtd_bdi_unmappable = {
21-
.capabilities = BDI_CAP_MAP_COPY,
22-
};
23-
24-
/*
25-
* backing device capabilities for R/O mappable devices (such as ROM)
26-
* - permits private mappings, copies are taken of the data
27-
* - permits non-writable shared mappings
28-
*/
29-
struct backing_dev_info mtd_bdi_ro_mappable = {
30-
.capabilities = (BDI_CAP_MAP_COPY | BDI_CAP_MAP_DIRECT |
31-
BDI_CAP_EXEC_MAP | BDI_CAP_READ_MAP),
32-
};
33-
34-
/*
35-
* backing device capabilities for writable mappable devices (such as RAM)
36-
* - permits private mappings, copies are taken of the data
37-
* - permits non-writable shared mappings
38-
*/
39-
struct backing_dev_info mtd_bdi_rw_mappable = {
40-
.capabilities = (BDI_CAP_MAP_COPY | BDI_CAP_MAP_DIRECT |
41-
BDI_CAP_EXEC_MAP | BDI_CAP_READ_MAP |
42-
BDI_CAP_WRITE_MAP),
43-
};

‎drivers/mtd/mtdcore.c‎

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
* Core registration and callback routines for MTD
33
* drivers and users.
44
*
5+
* bdi bits are:
6+
* Copyright © 2006 Red Hat, Inc. All Rights Reserved.
7+
* Written by David Howells (dhowells@redhat.com)
58
*/
69

710
#include <linux/module.h>
@@ -16,11 +19,39 @@
1619
#include <linux/init.h>
1720
#include <linux/mtd/compatmac.h>
1821
#include <linux/proc_fs.h>
22+
#include <linux/backing-dev.h>
1923

2024
#include <linux/mtd/mtd.h>
21-
#include "internal.h"
2225

2326
#include "mtdcore.h"
27+
/*
28+
* backing device capabilities for non-mappable devices (such as NAND flash)
29+
* - permits private mappings, copies are taken of the data
30+
*/
31+
struct backing_dev_info mtd_bdi_unmappable = {
32+
.capabilities = BDI_CAP_MAP_COPY,
33+
};
34+
35+
/*
36+
* backing device capabilities for R/O mappable devices (such as ROM)
37+
* - permits private mappings, copies are taken of the data
38+
* - permits non-writable shared mappings
39+
*/
40+
struct backing_dev_info mtd_bdi_ro_mappable = {
41+
.capabilities = (BDI_CAP_MAP_COPY | BDI_CAP_MAP_DIRECT |
42+
BDI_CAP_EXEC_MAP | BDI_CAP_READ_MAP),
43+
};
44+
45+
/*
46+
* backing device capabilities for writable mappable devices (such as RAM)
47+
* - permits private mappings, copies are taken of the data
48+
* - permits non-writable shared mappings
49+
*/
50+
struct backing_dev_info mtd_bdi_rw_mappable = {
51+
.capabilities = (BDI_CAP_MAP_COPY | BDI_CAP_MAP_DIRECT |
52+
BDI_CAP_EXEC_MAP | BDI_CAP_READ_MAP |
53+
BDI_CAP_WRITE_MAP),
54+
};
2455

2556
static int mtd_cls_suspend(struct device *dev, pm_message_t state);
2657
static int mtd_cls_resume(struct device *dev);

0 commit comments

Comments
 (0)