Commit b3ce3a83 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] drx-j: Get rid of typedefs on drxh.h

This were fixed with the help of this small perl script:

	#!/usr/bin/perl
	my $dir = shift or die "need a dir";
	my $type = shift or die "need type";
	my $var = shift or die "need var";
	sub handle_file {
		my $file = shift;
		my $out;
		open IN, $file or die "can't open $file";
		$out .= $_ while (<IN>);
		close IN;
		$out =~ s/\btypedef\s+($type)\s+\{([\d\D]+?)\s*\}\s+\b($var)[^\;]+\;/$type $var \{\2\};/;
		$out =~ s,\b($var)_t\s+,$type \1 ,g;
		$out =~ s,\bp_*($var)_t\s+,$type \1 *,g;
		$out =~ s,\b($var)_t\b,$type \1,g;
		$out =~ s,\bp_*($var)_t\b,$type \1 *,g;
		open OUT, ">$file" or die "can't open $file";
		print OUT $out;
		close OUT;
	}
	sub parse_dir {
		my $file = $File::Find::name;
		return if (!($file =~ /.[ch]$/));
		handle_file $file;
	}
	find({wanted => \&parse_dir, no_chdir => 1}, $dir);

Some manual work were needed.
Acked-by: default avatarDevin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 1bfc9e15
......@@ -327,7 +327,7 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c)
struct i2c_device_addr *demod_addr = NULL;
struct drx_common_attr *demod_comm_attr = NULL;
drxj_data_t *demod_ext_attr = NULL;
struct drxj_data *demod_ext_attr = NULL;
struct drx_demod_instance *demod = NULL;
struct drxuio_cfg uio_cfg;
struct drxuio_data uio_data;
......@@ -350,7 +350,7 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c)
if (demod_comm_attr == NULL)
goto error;
demod_ext_attr = kmalloc(sizeof(drxj_data_t), GFP_KERNEL);
demod_ext_attr = kmalloc(sizeof(struct drxj_data), GFP_KERNEL);
if (demod_ext_attr == NULL)
goto error;
......@@ -375,8 +375,8 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c)
demod->my_common_attr->intermediate_freq = 5000;
demod->my_ext_attr = demod_ext_attr;
memcpy(demod->my_ext_attr, &drxj_data_g, sizeof(drxj_data_t));
((drxj_data_t *)demod->my_ext_attr)->uio_sma_tx_mode =
memcpy(demod->my_ext_attr, &drxj_data_g, sizeof(struct drxj_data));
((struct drxj_data *)demod->my_ext_attr)->uio_sma_tx_mode =
DRX_UIO_MODE_READWRITE;
demod->my_tuner = NULL;
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment